Prometheus got OOMKilled after a developer added a `user_id` label to `http_requests_total`.
IntermediateTroubleshootingPrometheus SLIs & Recording Rules
Answer
Likely causes → Cardinality explosion: one series per user x route x code x pod.
Diagnose →
topk(10, count by (__name__) ({__name__=~".+"}))
count(count by (user_id) (http_requests_total))
Also check prometheus_tsdb_head_series before and after the deploy.
Fix → Drop the label at scrape time while the code is fixed:
metricRelabelings:
- action: labeldrop
regex: user_id
Then remove it from the instrumentation; per-user data belongs in logs or traces.
Prevent → Set sampleLimit on ServiceMonitors, alert on head series growth, and review metric labels in code review.
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