Skip to content

An extremely simple way to get some stats about your Sidekiq jobs in JSON.

License

Notifications You must be signed in to change notification settings

ForgeApps/sidekiq_json_stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidekiq JSON Stats

An extremely simple way to get some stats about your Sidekiq jobs in JSON.

Usage

Include the gem in your Gemfile:

gem 'sidekiq_json_stats'

Run bundle install

Add this to your config/routes.rb file:

mount SidekiqJsonStats::Engine, at: "/sidekiq-stats"

Specify the SIDEKIQ_JSON_STATS_TOKEN ENV variable (we use Figaro to do this).

Example using Figaro:

# config/application.yml
SIDEKIQ_JSON_STATS_TOKEN: "SuperS3cr3tCODEZ!"

You can get your stats at a /sidekiq-stats endpoint using curl:

curl http://my_app.dev/sidekiq-stats -H 'Authorization: Token token="SuperS3cr3tCODEZ!"

Data

The response currently looks like:

{
  "processed": 7449860,
  "failed": 6065976,
  "enqueued": 18,
  "queues": {
    "critical": 11,
    "default": 7,
    "low": 0
  }
}

Authorization

It uses HTTP Header based authorization. See the curl example under Usage.

If the supplied token is incorrect or missing a AbstractController::ActionNotFound error is raised rather than an Unauthorized 401.

Why

We wrote this so we can easily log this data in a consistent format from a variety of applications.

License

MIT

About

An extremely simple way to get some stats about your Sidekiq jobs in JSON.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published