Skip to content

Allow error rate SLIs

Sean McGivern requested to merge add-error-rates-to-slis into master

This MR allows defining custom error rate SLIs, in addition to apdex SLIs. This involves a few mechanical changes but results in the same metric names as before:

  1. Instead of using Gitlab::Metrics::Sli, callers now use either of Gitlab::Metrics::Sli::{Apdex,ErrorRate}.
  2. The names passed to those classes will auto-add the type to the metric name, to avoid repetition. For instance, Gitlab::Metrics::Sli::ErrorRate.new('rails_request') generates a metric named gitlab_sli:rails_request_error_rate:total.
  3. Apdex metric types create metrics for total and success_total. Error rate metric types create metrics for total and error_total, as it's more natural to talk about error rates as errors / total rather than (total - success) / total.
  4. The numerator metric is incremented using an success: argument for apdex, and an error: argument for error rates.

For gitlab-com/gl-infra/scalability#1395 (closed).

Edited by Sean McGivern

Merge request reports