How to determine if a plugin is in use

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 Plugin Usage Analyzer plugin version 2.0 is an updated version of the CloudBees Usage Plugin. This improved 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 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.

Prerequisites for using the Plugin Usage Analyzer plugin

To use this plugin, you must do the following:

  • Install CloudBees CI or CloudBees Jenkins Platform version 2.263 or later

  • Install the CloudBees Plugin Usage plugin version 2.0 or later on each master. See CloudBees Usage Plugin.

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. Plugin Usage Analyzer

Downloading the plugin usage report

The Plugin Usage Analyzer 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.