This is a job monitoring plugin, which watches for pipeline builds and automatically sends job and stage level stats to various endpoints, including:
For example:
pipeline {
agent any
stages {
stage('Stage 1') {
...
}
stage('Stage 2') {
...
}
}
}
Since it watches for changes from all pipeline jobs, it doesn't require modifying your Jenkinsfiles - once installed, it automatically provides stats for all pipeline jobs ran on the Jenkins controller.
Version 3.0 is listed as a breaking change in the Jenkins plugin update center. This is because the optional user/password for notifying InfluxDB now uses the credentials store instead of separate strings.
This is more secure, because otherwise the credentials are stored in plain text on the Jenkins controller.
If you are using the InfluxDB feature (and using user/password), you will need to reconfigure the plugin to get them from a Jenkins credential after upgrading. If this does not apply to you, you don't need to do anything after upgrading.
The plugin can be configured to send commit status for each stage for jobs built from a multibranch project. The GitHub page for the commit will initially show pending for each stage:
As each step is completed, the status will change to completed or error, depending on the outcome of the stage. At the end of a successful build, the PR page will show the following:
The plugin can also be configured to send job and stage stats to an InfluxDB instance, which can be used to build dashboards in Grafana to monitor build time and success rate. For example:
You can use the provided sample dashboards as-is, or as a starting point for you own dashboards. The sample dashboard shows overall build pass rate, average build time, and error counts for each stage.
The dashboard can be configured to show all jobs, or you can select the jobs you want to show.
By default, the plugin only provides status to Github. To enable reporting stats to InfluxDB for the Grafana dashboards:
A sample dashboard is available from Grafana.com. The sample dashboard provides a dropdown for all of the orgs with stats, and a second dropdown for all of the repos within an org.
To import the sample dashboard (instructions current as of Grafana 5.0):
Once you've imported the dashboard, just select the org you want to monitor, then select the repos you want to provide stats for.
The sample dashboard is just a starting point to demonstrate how the InfluxDB stats can be used to build dashboards. You can create dashboards that show more detailed information, such as graphs of build health over time. I'll continue to publish additional samples to Grafana.com as time permits.
As noted above, by default the plugin only provides status to Github. To enable reporting metrics to StatsD (introduced in 3.5.0):