How to determine if a plugin is in use

2 minute read

As a CloudBees CI administrator, you need to maintain and periodically clean up your inventory of plugins to keep your CloudBees CI instances lean. This is considered best practice to ensure system stability and optimal performance. Having fewer plugins also typically means less upgrade risk and less verification effort needed during an upgrade.

To help you maintain your plugin inventory, the CloudBees Plugin Usage Analyzer plugin automatically generates a weekly report that shows you where installed plugins are being used.

The CloudBees Plugin Usage Analyzer plugin analyzes existing builds and executions of Pipelines, configuration files in instances, and all active plugin dependencies to find the locations where plugins are used.

The CloudBees Plugin Usage Analyzer report shows the following information:

  • The names of your installed plugins

  • The number of detected usages

  • The names of the locations where each plugin is used

  • The date and time of the most recent usage, when used in projects

The analysis report is generated automatically. The first analysis runs between 15 and 60 minutes after Jenkins is restarted, and then every week thereafter at that same time.

Some plugins may not be included in the report because they are not directly mentioned in any stored configurations or the five most recent Pipeline executions. The report includes usage only for plugins in Freestyle jobs and Pipeline jobs. Plugins that do not contribute anything to jobs, for example security plugins such as active-directory and LDAP, are not included in the usage report.

Viewing a plugin usage report

The most recent plugin usage report is always available from the Plugin Usage screen.

To view a plugin usage report:

  1. Go to Manage Jenkins.

  2. In the Tools and Actions section, select Plugin Usage.

  3. To see the list of locations where a plugin is used, click the down arrow on the right side of the row for a plugin.

Plugin Usage Analyzer
Figure 1. CloudBees Plugin Usage Analyzer plugin

Downloading the plugin usage report

The CloudBees Plugin Usage Analyzer plugin report can be downloaded as a JSON file.

To download the report from the user interface:

  1. Go to Manage Jenkins.

  2. In the Tools and Actions section, select Plugin Usage.

  3. Select Download report.

To download the report from the command line:

  1. Type the following command:

    curl --user "user:userToken" --request GET https://instanceUrl/pluginUsage/download
    • For user, enter a user with Administrator permissions

    • userToken is a token generated by this user

    • instanceUrl is the root url of the instance

Canceling a plugin usage report

You can cancel an analysis while it is in progress.

It may take some time for the analysis to stop after you cancel it. The analysis of the current element or the gathering of elements to be analyzed must complete before the analysis can stop.

To cancel a plugin usage report:

  1. Go to Manage Jenkins.

  2. In the Tools and Actions section, select Plugin Usage.

  3. Select Cancel analysis.

  4. Click OK.

Turning off plugin usage analysis

Plugin usage analysis is turned on by default. You can turn off the analysis at any time.

To turn off plugin usage analysis:

  1. Go to Manage Jenkins.

  2. In the Tools and Actions section, select Plugin Usage.

  3. Select Turn off analysis.

Turning on plugin usage analysis

To turn on plugin usage analysis:

  1. Go to Manage Jenkins.

  2. In the Tools and Actions section, select Plugin Usage.

  3. Select Turn on analysis.