Prometheus `rate()` Graph Shows Missing Data or Sudden Zeroes (Wrong Metric Type / Interval)
Used `rate()` on a Gauge instead of a Counter, or scrape interval exceeded `[1m]` range window.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: Prometheus `rate()` Graph Shows Missing Data or Sudden Zeroes (Wrong Metric Type / Interval)
Platform: Observability
Common Root Causes:
- Used `rate()` on a Gauge instead of a Counter, or scrape interval exceeded `[1m]` range window.
Interactive Diagnostic Checklist
Verified Solutions:
- Use `rate()` strictly on monotonic `_total` Counters with a range >= 4x `scrape_interval` (`$__rate_interval`).
Safe Diagnostic Command:
Inspect scrape_interval vs PromQL range vector
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Used `rate()` on a Gauge instead of a Counter, or scrape interval exceeded `[1m]` range window. Recommended diagnostic: `Inspect scrape_interval vs PromQL range vector`. Remediation: Use `rate()` strictly on monotonic `_total` Counters with a range >= 4x `scrape_interval` (`$__rate_interval`).
Worked Examples
- Run `Inspect scrape_interval vs PromQL range vector` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-prometheus-counter-reset-rate-spike · Independently verified: 2026-11-25