Coder Social home page Coder Social logo

resque_exporter's Introduction

resque_exporter

An exporter of Prometheus for resque's status.

Usage

Options:

  -h, --help            display help
  -v, --version         display version and revision
  -p, --port[=5555]     set port number
  -c, --config          set path to config file

e.g.

$ ./resque_exporter --config /path/to/config.yml

Description

This exporter exports following items.

  • Number of remained jobs in queue
  • Number of processed jobs
  • Number of failed jobs
  • Number of jobs in the failed queue
  • Number of total workers
  • Number of active workers
  • Number of idle workers

Paths that supported by this exporter

Paths Description
/metrics Exports metrics
/* Path for health check

Configuration

You may write configuration file and pass that through CLI option.
Please refer to sample_config.yml.

Sample Output

# HELP resque_jobs_in_queue Number of remained jobs in queue
# TYPE resque_jobs_in_queue gauge
resque_jobs_in_queue{queue_name="image_converting"} 0
resque_jobs_in_queue{queue_name="log_compression"} 0
# HELP resque_failed Number of failed jobs
# TYPE resque_failed gauge
resque_failed 123
# HELP failed_queue_count Number of jobs in the failed queue
# TYPE failed_queue_count gauge
failed_queue_count 1
# HELP resque_processed Number of processed jobs
# TYPE resque_processed gauge
resque_processed 1.234567e+06
# HELP resque_active_workers Number of active workers
# TYPE resque_active_workers gauge
resque_active_workers 2
# HELP resque_idle_workers Number of idle workers
# TYPE resque_idle_workers gauge
resque_idle_workers 8
# HELP resque_total_workers Number of workers
# TYPE resque_total_workers gauge
resque_total_workers 10

Mechanism

This exporter accesses to redis to aggregate status.

  1. Collect name of queues via <namespace>:queues entry (by using SMEMBERS)
  2. Get number of remained jobs for each queue via <namespace>:queue:<queue_name> entry (by using LLEN)
  3. Get number of processed jobs via <namespace>:stat:processed
  4. Get number of failed jobs via <namespace>:stat:failed
  5. Collect name of workers via <namespace>:workers entry (by using SMEMBERS)
  6. Count number of active workers and idle workers by getting for each workers status entry <namespace>:worker:<worker_name>.

Health Check

Any paths that except for /metrics returns response for health check. It returns 200 HTTP status code.

Note

This exporter also supports resque compatible job-queue engine (e.g. jesque).

[For developers] How to build to release

Execute VERSION=${version} make. Built binaries will be on bin directory.

License

The MIT License (MIT)
Copyright © 2016 moznion, http://moznion.net/ <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

resque_exporter's People

Contributors

moznion avatar mrwacky42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

resque_exporter's Issues

How to debug scrape failures?

Hi,

first off: Thanks for writing this. I am having troubles getting this to run though. The only thing that increases for me are the 'resque_exporter_scrape_failures_total' - but how can I debug why the exporter is failing?

Here is my configuration:

resque_namespace: 'resque:admin_server'
guard_interval_millis: 0
redis:
    host: 10.1.1.1
    port: 6379
    db: 0
    password: notimportant

What do I do if I do not have any password? If I connect with redis-cli -h 10.1.1.1 -a I really could put anything into the space behind the -a.

Thanks ahead for your support!

EDIT:
Ok so I just taught myself go and how to setup your project... Turns out that the password does matter. So I guess I would need to prepare a pull request that tests wether or not a password is defined and based on the results opens the redis connection.

EDIT2:
So it turns out if password is set to an empty string '', it works fine. It even works with an empty space, but not with any arbitrary phrase like the redis-cli. A log.Fatal(err) above line 103 in exporter.go would help a lot though. This way the resque_exporter would show errors, which would be really helpful.

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.