Skip to content

Expose metric names and their labels and selectors for SLIs

Gregorius Marco requested to merge mg-unified-scoped-sli-aggregations into master
Latest AI-generated summary Experiment

The first part of gitlab-com/gl-infra/scalability#2602 (closed) to achieve unified recording rule registry.

This MR implements a new sliMetricsDescriptor object with the following methods:

  • metricNamesAndAggregationLabels() returns a hash of { metric: set(labels) }
  • metricNamesAndSelectors() returns a hash of { metric: { label: { oneOf: [value] } } }.
    • The selectors for the same metric are being merged together so the resulting selector is in the form of { label: { oneOf: [v1, v2, v3,...] } }. See the tests in libsonnet/servicemetrics/service_level_indicator_helper_test.jsonnet for the examples.

The metrics and labels will be used to generate the sli_aggregations recording rules (first layer of aggregation from source metrics) for that service (in !6711 (merged)).

Edited by Gregorius Marco

Merge request reports