Skip to main content

A Prometheus exporter for Buildbot

Project description

buildbot-prometheus is a Python package providing a Prometheus metrics exporter for a buildbot master. The package works on Python 3.

Installation

$ pip install buildbot_prometheus

The setup.py file includes an entry_points directive that configures it as a Buildbot reporters plugin which simplifies its use in the Buildbot configuration file.

To use the Prometheus reporter plugin add the following to your buildbot master.cfg file and (re)start the master.

c['services'].append(reporters.Prometheus(port=9100))

The buildbot master should now be exposing metrics to Prometheus. You can check the metrics service using the simple command line tool curl:

$ curl -s localhost:9100/metrics | grep -v "#" | sort
buildbot_build_requests_duration_seconds{builder_id="1"} 2.0
buildbot_build_requests_success{builder_id="1"} 1.0
buildbot_builders_running_total 1.0
buildbot_builders_running{builder_id="1",builder_name="runtests"} 1.0
buildbot_builds_duration_seconds{builder_id="1",worker_id="2"} 2.571184
buildbot_builds_success{builder_id="1",worker_id="2"} 1.0
buildbot_buildsets_duration_seconds{buildset_id="8"} 2.0
buildbot_buildsets_success{buildset_id="8"} 1.0
buildbot_steps_duration_seconds{builder_id="1",step_name="git",step_number="0",worker_id="2"} 1.742647
buildbot_steps_duration_seconds{builder_id="1",step_name="shell",step_number="1",worker_id="2"} 0.334757
buildbot_steps_success{builder_id="1",step_name="git",step_number="0",worker_id="2"} 1.0
buildbot_steps_success{builder_id="1",step_name="shell",step_number="1",worker_id="2"} 1.0
buildbot_workers_running_total 1.0
buildbot_workers_running{worker_id="2",worker_name="worker1"} 1.0

A configuration block such as the following example should be added to the Prometheus configuration file to instruct it to scrape the buildbot metrics exporter.

scrape_configs:
  - job_name: 'buildbot'
    target_groups:
      - targets: ['localhost:9100']

Prometheus will then automatically associate a job label of buildbot with metrics from this exporter. Prometheus will also automatically associate an instance label (e.g. ‘localhost:9100’) too.

All metrics exposed by this exporter are prefixed with the buildbot_ string as a namespace strategy to isolate them from other Prometheus exporters. This makes them easier to find in metrics consumer and visualisation tools such as Grafana.

All duration metrics use seconds as the unit of measure.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

buildbot_prometheus-22.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file buildbot_prometheus-22.0.0-py3-none-any.whl.

File metadata

  • Download URL: buildbot_prometheus-22.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.4

File hashes

Hashes for buildbot_prometheus-22.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0cf796e4b5d422c2043cf860115aafea5c44ab32b25043913a60bc9f96a3b40
MD5 da161c70b8d7a2f77641ad98dab2a754
BLAKE2b-256 9f88dfddd9927138e0c49c6a88eb7f7a9d64de11ef1a9a78b91abaca175eb73c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page