feat: Custom SLO for User Experience SLIs

Description

Adds an optional slo object to User Experience SLI definitions, so SLI owners can set custom Apdex and error SLOs per User Experience SLI:

slo:
  apdex_pct: 99.9
  error_pct: 0.1
  • slo.apdex_pct is the minimum percentage of experiences that must complete within the Apdex threshold.
  • slo.error_pct is the maximum percentage of experiences that may end in an error.

Both keys are optional, and so is slo itself. Values must be greater than 0 and less than 100, and no other keys are allowed inside slo. Values are percentages so registry definitions are easy for SLI owners to read.

In Ruby, Labkit::UserExperienceSli::Definition gets a new slo: attribute (defaults to nil) holding a Labkit::UserExperienceSli::Slo with apdex_pct and error_pct (both default to nil). Existing keyword callers keep working.

LabKit only validates and preserves these values. It does not use them when recording metrics, and it does not apply defaults: SLOs are a monitoring/alerting concern, and consumers fall back to their own defaults (currently 99.95 / 0.05) when a value is omitted.

Downstream

Part of gitlab-com/gl-infra/observability/team#4467

Edited by Hercules Merscher

Merge request reports

Loading
Loading