/jenkins_exporter

Prometheus exporter for Jenkins

Primary LanguageGoApache License 2.0Apache-2.0

Jenkins Exporter

Build Status Go Doc Go Report Join the chat at https://gitter.im/webhippie/general

A Prometheus exporter that collects Jenkins statistics.

Installation

If you are missing something just write us on our nice Gitter chat. If you find a security issue please contact thomas@webhippie.de first. Currently we are providing only a Docker image at tboerger/jenkins-exporter.

Usage

# docker run -ti --rm quay.io/seibertmedia/jenkins-exporter -h
Usage of jenkins_exporter:
  -jenkins-address string
      Address where to reach Jenkins
  -jenkins-password string
      Password to authenticate on Jenkins
  -jenkins-username string
      Username to authenticate on Jenkins
  -log.format value
      Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true" (default "logger:stderr")
  -log.level value
      Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal] (default "info")
  -version
      Print version information
  -web.listen-address string
      Address to listen on for web interface and telemetry (default ":9103")
  -web.telemetry-path string
      Path to expose metrics of the exporter (default "/metrics")

Development

Make sure you have a working Go environment, for further reference or a guide take a look at the install instructions. It is also possible to just simply execute the go get github.com/seibert-media/jenkins_exporter command, but we prefer to use our Makefile:

make deps
make dev

Metrics

# HELP jenkins_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which jenkins_exporter was built.
# TYPE jenkins_exporter_build_info gauge
jenkins_exporter_build_info{branch="master",goversion="go1.8.1",revision="4792fdc30a695a1a19d54ffe395d0f838d6d8cee",version="0.1.0"} 1
# HELP jenkins_job_color Color code of the Jenkins job
# TYPE jenkins_job_color gauge
jenkins_job_color{name="build-project-1"} 0
jenkins_job_color{name="build-project-2"} 0
jenkins_job_color{name="build-project-3"} 0
jenkins_job_color{name="build-project-4"} 0
jenkins_job_color{name="build-project-5"} 1
# HELP jenkins_up Check if Jenkins response can be processed
# TYPE jenkins_up gauge
jenkins_up 1

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

Apache-2.0 originally forked from https://github.com/webhippie/jenkins_exporter

Copyright

Copyright (c) 2017 //SEIBERT/MEDIA GmbH <docker@seibert-media.net>
while crucial parts may still fall under the original authors copyright:
Copyright (c) 2017 Thomas Boerger <http://www.webhippie.de>