Skip to content

Prometheus exporter that collects metrics from beanstalkd.

License

Notifications You must be signed in to change notification settings

dramosOptiply/beanstalkd_exporter

 
 

Repository files navigation

Go Report Card Maintainability Test Coverage Build Status

Beanstalkd Exporter for Prometheus

This is a simple server that scrapes beanstalkd stats and exports them via HTTP for Prometheus consumption.

Getting Started

To run it:

$ ./beanstalkd_exporter [flags]

Help on flags:

$ ./beanstalkd_exporter --help

For more information check the source code documentation.

Usage

Specify the address of the beanstalkd instance using the --beanstalkd.address flag. For example,

$ ./beanstalkd_exporter --beanstalkd.address=127.0.0.1:11300

The default address is localhost:11300.

Example With Beanstalkd

Start a beanstalkd instance with the following docker command.

$ docker run -d -p 11300:11300 --name beanstalkd dtannock/beanstalkd:latest

Run beanstalkd_exporter. The default flag values should be able to connect to the running beanstalkd instance.

$ ./beanstalkd_exporter

Fetch the metrics for Prometheus.

$ curl -s http://localhost:8080/metrics

Failed Scrapes

Of the failed scraping strategies described here, the up variable is used.

You can see this in practice by starting/stopping the docker container, and fetching the metrics, then find the beanstalkd_up value.

$ docker stop beanstalkd
$ curl -s http://localhost:8080/metrics | grep beanstalkd_up
$ docker start beanstalkd
$ curl -s http://localhost:8080/metrics | grep beanstalkd_up

Metrics

Without passing any flags, only the system-level stats will be collected from beanstalkd (i.e. tube-level stats will not be collected).

To collect tube-level stats, you must use either the --beanstalkd.allTubes or --beanstalkd.tubes flag.

--beanstalkd.allTubes will collect metrics for all tubes.

$ ./beanstalkd_exporter --beanstalkd.allTubes

--beanstalkd.tubes will collect metrics for one or more specific tubes.

$ ./beanstalkd_exporter --beanstalkd.tubes=default,anotherTube

The metrics collected from beanstalkd can be filtered using the --beanstalkd.systemMetrics and --beanstalkd.tubeMetrics flags. For example,

$ ./beanstalkd_exporter \
    --beanstalkd.systemMetrics=current_jobs_urgent_count,current_jobs_ready_count \
    --beanstalkd.tubes=default \
    --beanstalkd.tubeMetrics=tube_current_jobs_ready_count

Will fetch only 2 system-level metrics, and 1 metric labelled for the default tube.

The full list of metrics is available on this page.

Development

Building

$ make build

Testing

$ make test

License

Apache License 2.0, see LICENSE.

About

Prometheus exporter that collects metrics from beanstalkd.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 95.8%
  • Makefile 3.6%
  • Dockerfile 0.6%