Scrapes fail intermittently with `context deadline exceeded`.
IntermediateTroubleshootingPrometheus SLIs & Recording Rules
Answer
Likely causes → The /metrics endpoint takes longer than scrapeTimeout (default 10s): huge cardinality, expensive collectors, or a CPU-throttled pod.
Diagnose →
time curl -s localhost:8080/metrics | wc -l
scrape_duration_seconds{job="checkout"}
scrape_samples_scraped{job="checkout"}
Fix → Reduce cardinality (drop per-user or per-URL labels), raise CPU limits, or increase scrapeTimeout modestly (must stay below the interval).
Prevent → Alert on scrape_duration_seconds approaching the timeout and on sample count growth.
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