Pipeline monitor plugin
is an Jenkins plugin that is capable of automatically collecting pipeline build, stage, testing and coverage data and forward such key data to remote center (e.g., elasticsearch) for further exploitation.
- Generate the
pipeline-monitor.hpi
file undertarget
directory with command:mvn clean package
- Copy the generated
hpi
file to the directory$JENKINS_HOME/plugins
- Restart jenkins
pipeline-monitor-plugin
is configured at Jenkins global configuration page (Jenkins home -> Manage Jenkins -> Configure System).
You can specify whether to enable this plugin, how to connect to Elasticsearch, and etc.
One example data is as below. It shows that the result of pipeline stage checkout
of job test-pipeline
is CompletedSuccess
and the duration is 50ms
.
{
"_index": "test-jenkins",
"_type": "job-data",
"_id": "Ks9Dp24BMQms4qjvQk0n",
"_source": {
"PipelineStageStatus": {
"jenkinsUrl": "http://127.0.0.1:49001/",
"jobName": "test-pipeline",
"number": 42,
"name": "checkout",
"startTime": 1574764231812,
"result": "CompletedSuccess",
"duration": 50
},
"@timestamp": "2019-11-26T10:30:31.815+0000"
}
}
- Post restful messages to Elasticsearch
- Collect pipeline build result
- Collect pipeline stage result
- Collect semi-standard xUnit test result
- Collect semi-standard Cobertura test coverage result
- Collect diff coverage result (Pending, may be a dedicated diff-coverage-plugin is preferred)
MIT
Fork the project on Github, make your feature addition or bug fix, write tests, commit, and then send out pull request.