Use it when panels show "No data" or alerts silently stop.
Missing Metrics
Missing metrics: a series stops or never appears because the target is down, scrape fails, relabelling drops it, the metric name/labels changed, or the code path never ran.
1. Target health: up{job="<job>"}.
2. Raw output: curl -s http://<target>/metrics | grep <metric>.
3. Dropped targets/metric relabelling.
4. Name or label changed in a new version?
5. Alert: absent(up{job="<job>"}).
code path runs → metric exposed → scraped → kept by relabel → stored
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Query the raw metric without label filters. Compare with the target's /metrics output directly.
Step 2 Troubleshooting order Narrow the fault
1. Is the target up? up{job="x"} and the Targets page (scrape error message).
2. Does the endpoint return the metric? curl host:port/metrics | grep name.
3. Did the metric name or labels change after an upgrade?
4. Relabeling or metric_relabel_configs dropping it?
5. Service discovery still finding the target (labels/annotations changed)?
6. For pushed data (OTLP/remote write): collector or backend errors and dropped counters.
Use absent(metric) alerts for critical metrics.
Step 3 Common failures Narrow the fault
Library upgrades often rename metrics (for example adding _total). An alert on a missing series never fires. Time range or data source variables on the dashboard can point at the wrong environment.
Absence doesn't trigger normal alerts — use absent() or up == 0. Check target status, then the raw /metrics output.
up{job="<job>"}— first check for this topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool check config prometheus.yml— config valid
ReferenceWhat it is1 section · depth on demand
How it works
Data can vanish at each step: the application stops exposing it, discovery drops the target, relabelling removes labels, or the query uses labels that no longer exist.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Follow the data path, stop at the first break
| Step | Check | Points at |
|---|---|---|
| 1. Discovery | Status → Service Discovery: target listed? dropped? | SD config, relabel keep, RBAC |
| 2. Scrape | up{job="x"}, Targets page error text | Network, TLS, auth, wrong port/path, timeout |
| 3. Exposition | curl -s http://target:port/metrics \| grep metric_name | App not exposing it, renamed metric |
| 4. Ingestion | scrape_samples_scraped, scrape_samples_post_metric_relabeling, sample limit errors | metric_relabel_configs drop, sample_limit |
| 5. Query | Metric without label filters; correct time range; staleness | Typo, label changed, data older than 5 min |
| 6. Remote store | Same query against Prometheus vs long-term store | Remote write lag or drops |
Classic causes
| Symptom | Cause |
|---|---|
| Metric existed until an upgrade | Client library renamed it (e.g. _total suffix, OpenTelemetry . → _ conversion, units added) |
| Gaps in graphs | Scrape timeouts (scrape_duration_seconds near scrape_timeout), target restarts |
| Series ends 5 minutes after the target vanished | Staleness handling — expected |
| Only some pods have it | Annotation or label missing on part of the Deployment |
| Present in Prometheus, missing in Grafana | Data source, variable filter or $__rate_interval problem |
Alerting on absence
An alert on error_ratio > 0.05 is silent when the metric disappears. Add explicit absence alerts:
up{job="checkout"} == 0 # target exists but scrape fails
absent(up{job="checkout"}) # target gone from discovery entirely
absent_over_time(backup_last_success_timestamp_seconds[26h]) # push/textfile metrics that stopped
absent() returns a series only when nothing matches, so it needs a selector specific enough to identify the thing that should exist.
Common mistakes
- Target down but no alert on
up == 0.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.