Code Monkey home page Code Monkey logo

buildbot-prometheus's Introduction

Buildbot Prometheus Exporter

buildbot-prometheus is a Python package providing a Prometheus metrics exporter for a buildbot master. The package should work on Python 2 and 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=9101))

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:9101']

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:9101') 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.

buildbot-prometheus's People

Contributors

claws avatar gabrielnagy avatar majin42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.