Allow using the feature_category label from the source metrics in feature category recordings for service SLIs (provide opt-in)
To include SLIs with a fixed featureCategory into the error budget for stage groups, we're generating recording rules that will feed into the budget for each service like that: https://gitlab.com/gitlab-com/runbooks/blob/dde7b5ef3270e8ff3ebb2dbd9cf6ca72b59239c4/rules-jsonnet/service-key-metrics.jsonnet#L9
The SLI defined in #1228 (closed) would have the feature category set directly on the source metric, we should allow that to feed directly into the error budget without having separate recordings for the puma
component in https://gitlab.com/gitlab-com/runbooks/blob/dde7b5ef3270e8ff3ebb2dbd9cf6ca72b59239c4/metrics-catalog/services/lib/puma-per-feature-category-recording-rules.libsonnet.
To do that, we'd have to allow an SLI definition to specify that the feature_category
should be part of the recordings aggregation rather than a static label. This means that the recordings that are currently part of the autogenerated-key-metrics
would be added to autogenerated-feature-category-metrics
.
We could allow specifying a magic string as the featureCategory
that would generate these rules for the SLI.
That means the SLI would end up looking like this:
serviceLevelIndicators: {
rails: {
featureCategory: featureCategories.fromSourceMetrics // a constant defined somewhere
apdex: successRateApdex(successConter)
requestRate: rateMetric(totalCounter)
significantLabels: ['feature_category'] // must be included otherwise an assertion should fail
}
}
Which would generate the gitlab:component:feature_category:execution:apdex
recording rules aggregating on the feature category. Allowing us to remove the custom recording for the puma component.