Pro Metrics

Mike Perham edited this page Feb 2, 2017 · 1 revision

Sidekiq Pro can send runtime metrics to Statsd for distribution to Graphite, Librato Metrics, etc. Create a statsd client and hand it to the server middleware in your initializer, like so:

METRICS = Statsd.new(statsd_host, 8125)

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    require 'sidekiq/middleware/server/statsd'
    chain.add Sidekiq::Middleware::Server::Statsd, :client => METRICS
  end
end

where METRICS is your statsd-ruby client instance.

Metrics

Sidekiq Pro will send the following metrics for a worker named Foo::BarWorker:

jobs.Foo.BarWorker.count => counter
jobs.Foo.BarWorker.success => counter
jobs.Foo.BarWorker.failure => counter
jobs.Foo.BarWorker.perform => gauge (time)
jobs.count => counter
jobs.success => counter
jobs.failure => counter

i.e. count will always be incremented. success or failure will be incremented based on the outcome. perform tracks the amount of time spent in the worker.