Instrumenting your models using Oma Stats

OMA::Stats uses StatsD to our Graphite Server. Here is an overview of what the various types of buckets mean.

StatD metric hierarchy and standards

Top Level Stats (OMA)

  • Error stats - 'oma.#{env}.web.error.count, instrumented with helper log_ux_error

  • Slow stats - "oma.#{env}.web.slow.count", instrumented with helper log_ux_slow

  • Confusing stats - "oma.#{env}.web.confusing.count", instrumented with helper log_ux_confusing

Top Level Hierarchy

  • Performance stats - default logs for every page load is: 'oma.#{env}.web.performance.*'

  • User stats - default logs for user experience is: 'oma.#{env}.web.user.*

  • Routing stats - errors with bad paths, etc: 'oma.#{env}.web.routing.*

  • Error stats - when we get an error: oma.#{env}.web.error.*

Every front end request is logged in StatsD for its timing. In addition, there is an overview bucket that shows performance by environment as well that is logged on every request. This is so we can describe an overall UX for our customers.

This tracking is in the oma.stats

Logging User Experience

When a user experiences something slow, or an error, we should bulk up these statistics. The buckets are:

  • Slow queries = "user.#{user.id}.ux.slow

  • Error messages = "user.#{user.id}.ux.error

There are helpers implemented in oma's application_controller that help with this. Just use the term:

  • log_ux_slow

  • log_ux_error

  • log_ux_confusing

The goal is to have the user experience improve to where the user does not experience any of these items.

Last updated