Allow error rate SLIs
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:
- Instead of using
Gitlab::Metrics::Sli, callers now use either ofGitlab::Metrics::Sli::{Apdex,ErrorRate}. - 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 namedgitlab_sli:rails_request_error_rate:total. - Apdex metric types create metrics for
totalandsuccess_total. Error rate metric types create metrics fortotalanderror_total, as it's more natural to talk about error rates aserrors / totalrather than(total - success) / total. - The numerator metric is incremented using an
success:argument for apdex, and anerror:argument for error rates.
Edited by Sean McGivern