The following will install the exporter whose entrypoint binary is called jenkins-exporter
:
pip3 install prometheus-jenkins-exporter
The exporter accepts configuration via environment variables. Ie.
JENKINS_URL="https://my-jenkins.com" jenkins-exporter
The following table shows the supported environment variables:
Environment variable | Required | Default | Description |
---|---|---|---|
JENKINS_URL |
yes | Jenkins endpoint | |
JENKINS_USER |
no | "" |
Login username |
JENKINS_PASS |
no | "" |
Login password |
METRICS_PREFIX |
no | jenkins |
Exported metrics prefix |
EXPORTER_PORT |
no | 8000 |
Exporter listening port |
EXPORTER_LOG_LEVEL |
no | INFO |
Log level. Can ben DEBUG , INFO , WARNING , ERROR , CRITICAL |
This exporter has not been designed to export all Jenkins metrics, but code should be simply enough to fork and add metrics you need. The main reason is that we could export a bunch of metrics from Jenkins, but apparently everyone has a different use case. In our case, for example, we don't want to monitor Jenkins jobs status (since we believe it should be done by Jenkins itself), while we do export few metrics we care monitoring about.
jenkins_up
jenkins_queue_oldest_job_since_seconds
jenkins_plugins_enabled_count
jenkins_plugins_enabled_with_update_count
jenkins_slave_up
docker-compose build && docker-compose run dev sh
pycodestyle --max-line-length=180 prometheus_jenkins_exporter/*.py
- Release new version on GitHub
- Update version in
setup.py
- Run
python3 setup.py sdist
- Upload it with
twine upload dist/*
- Upload the files to the Github release
This software is released under the MIT license.