Giter Site home page Giter Site logo

olimpias / beanstalkd_exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from messagebird/beanstalkd_exporter

0.0 0.0 0.0 2.18 MB

A beanstalkd stats exporter for Prometheus

Home Page: https://www.messagebird.com

Shell 5.03% Go 92.53% Dockerfile 2.44%

beanstalkd_exporter's Introduction

Beanstalkd Exporter

Build Status

Beanstalkd Exporter is a beanstalkd stats exporter for Prometheus.

How does it work?

Every now and then, Prometheus will request a "scrape" of metrics from this application via an HTTP request to /metrics. During this scrape request the exporter will connect to beanstalk and ask for stats. Stats are fetched for the whole instance and for each individual tube.

If you have many tubes and fetching stats one-by-one takes longer than your allowed scrape duration configured in prometheus, you can increase the number of concurrent tube stats workers via the -num-tube-stat-workers flag, to parallelize the work required.

Usage

Running beanstalkd_exporter is as easy as executing beanstalkd_exporter on the command line. One argument is required: -mapping-config (see below for what it needs).

$ beanstalkd_exporter -config examples/servers.conf -mapping-config examples/mapping.conf

Use the -h flag to get help information.

$ beanstalkd_exporter -h
Usage of ./bin/beanstalkd_exporter:
  -beanstalkd.address string
    	Beanstalkd server address (default "localhost:11300")
  -log.level string
    	The log level. (default "warning")
  -mapping-config string
    	A file that describes a mapping of tube names.
  -poll int
    	The number of seconds that we poll the beanstalkd server for stats. (default 30)
  -sleep-between-tube-stats int
    	The number of milliseconds to sleep between tube stats. (default 5000)
  -num-tube-stat-workers int
    	The number of concurrent workers to use to fetch tube stats. (default 1)
  -web.listen-address string
    	Address to listen on for web interface and telemetry. (default ":8080")
  -web.telemetry-path string
    	Path under which to expose metrics. (default "/metrics")

Tube name mapping

Sometimes tubes names are complicated. Sometimes tubes are dedicated to entities like users and carry on their names the user id. But it is interesting to stat all these diffent but similar tubes together. To do this you can give beastalkd_exporter a mapping config file.

Say you have many tube names like

incoming-emails-7822
incoming-emails-1235
incoming-emails-8882
...

These tubes hold incoming emails for specific users. If you ran beanstalkd_exporter without any mapping you would get stats like this:

tube_current_jobs_ready{tube="incoming-emails-7822"}
tube_current_jobs_ready{tube="incoming-emails-1235"}
tube_current_jobs_ready{tube="incoming-emails-8882"}
...

And it would be hard to group all of them together to know things like "what is the total size of 'incoming emails' tubes".

So we create a mapping config file ("./mapping.conf") with this contents:

incoming-emails-(\d+)
name="incoming-emails"
user_id="$1"

some-other-tube-(\w+)-processor-(\d+)
name="some-other-tube"
processor="$1"
node_id="$2"

(the file format was heavily inspired by statsd_exporter's stat mapping format.)

Run beanstalkd_exporter with the option "-mapping-config" like this:

beanstalkd_exporter -mapping-config="./mapping.conf"

and the resulting stats will be like

tube_current_jobs_ready{tube="incoming-emails",user_id="7822"}
tube_current_jobs_ready{tube="incoming-emails",user_id="1235"}
tube_current_jobs_ready{tube="incoming-emails",user_id="8882"}

License

beanstalkd_exporter is licensed under The BSD 2-Clause License. Copyright (c) 2016, MessageBird

beanstalkd_exporter's People

Contributors

bryanlarsen avatar marcelcorso avatar samwierema 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.