Skip to content

Enforce metrics selector as object

Gregorius Marco requested to merge mg-validate-metric-selectors into master

This came up from @reprazent in !6612 (comment 1705490969) where we want to expose the metric names and labels for each SLI's metrics.

In gitlab-com/gl-infra/scalability#2602 (closed), we want to generate sli_aggregations recording rule which is the first aggregation layer for all source metrics defined in SLIs.

To properly capture the labels for the source metrics, we need the selectors to be an object so we can expose the labels easily, then we can use getMetricNamesAndLabels() (example: histogram) for all metrics.

In this MR:

  • adds a validation for all metrics definitions
  • replaces all string selectors with object selectors
Edited by Gregorius Marco

Merge request reports