Skip to content
Dotan J. Nahum edited this page Jan 3, 2014 · 9 revisions

There are some obvious but not so obvious questions you want to answer once you go production with a worker

  • How long did it take to process a job
  • How big are the messages
  • How is the message handling looking? how many errors? rejects? accepts? requeues?

It's a pity to redo these every time again, and Sneakers will do it automatically for you in an opinionated (and polite) way

Sneakers::Metrics

The metric variate will be a worker's class name.

  • Counter: job start
  • Counter: job end
  • Counter: message handling and type (ack/reject/etc.)
  • Timer: job length
  • Timer: message size (to-be-implemented)

So for a worker called LogProcessor, in a StatsD provider, a metric would look like this:

prefix.work.LogProcessor.started.postfix

Given that perfix and postfix are yours to set at the statsd level unrelated to Sneakers. I like to have [environment][product] as prefix and [hostname] as postfix.

Types of Built In Metrics Providers

  • NullMetrics - good when you don't really want metrics, or are doing it custom on your own in the worker body
  • StatsdMetrics - production use with Statsd
  • NewrelicMetrics - production use with NewRelic, contributed by @arielze
  • LogMetrics - useful to see metrics as they happen as part of logging