Interview Prep/Monitoring & Observability/Prometheus scraping and targets

`up` is 1 but a specific metric is missing from the target

BeginnerTroubleshootingPrometheus scraping and targets
Answer

Likely causes → The app has not registered the metric yet (lazy init until first event), a metric_relabel_configs rule dropped it, or the name changed in a library upgrade (e.g. _total suffix added).

Diagnose →

curl -s http://app:8080/metrics | grep -i request

Compare with the metric_relabel_configs of the job.

Fix → Initialise counters at zero for known label values in code, fix the drop rule, update queries to the new name.

Prevent → Pre-initialise metrics and test exposition in CI.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus scraping and targets