Joining SLI series with `kube_pod_labels` to add a `team` label fails with `many-to-many matching not allowed: matching labels must be unique on one side`.
AdvancedTroubleshootingPrometheus SLIs & Recording Rules
Answer
Likely causes → Both sides have multiple series per matching key: kube_pod_labels can have duplicates (several kube-state-metrics replicas, or pods recreated with the same name), and the SLI side is not unique either.
Diagnose →
count by (namespace, pod) (kube_pod_labels) > 1
Fix → Make one side unique with aggregation and use group_left:
sum by (namespace, pod) (rate(http_requests_total[5m]))
* on (namespace, pod) group_left(label_team)
max by (namespace, pod, label_team) (kube_pod_labels)
Prevent → Prefer static team labels via ServiceMonitor relabeling or podTargetLabels instead of runtime joins in SLO rules.
More on Prometheus SLIs & Recording Rules
You applied a `PrometheusRule` for your SLO, but `slo:sli_error:ratio_rate5m` returns nothing in Prometheus.Beginner`promtool check rules` fails with `could not parse expression: 1:72: parse error: unexpected right parenthesis ')'`.BeginnerThe availability SLI panel shows `NaN` every night between 02:00 and 05:00.BeginnerYour per-route SLI query fails with `found duplicate series for the match group {route="/api/checkout"} on the right hand-side of the operation`.IntermediatePrometheus logs `vector contains metrics with the same labelset after applying rule labels` for your SLI recording rule.AdvancedYour latency SLI using `le="0.3"` returns an empty result, but the histogram exists.Intermediate