What is the Pushgateway, and why is it discouraged for most cases? [Basic]
Answer
The Pushgateway lets short-lived jobs push metrics that Prometheus can later scrape. It is discouraged for most cases because it bypasses normal target health semantics, can become a bottleneck, and can leave stale metrics if lifecycle cleanup is not handled.
Technical explanation
Prometheus recommends the pull model for most services because it naturally exposes target availability through up.
Pushgateway is appropriate for service-level batch job results, not per-instance machine metrics or long-running services.
If used, metrics should include grouping keys carefully and be deleted when the job is no longer relevant.
Hands-on example
Example: a nightly reconciliation job pushes reconciliation_last_success_timestamp_seconds and reconciliation_records_processed_total to Pushgateway. Alert if time() - reconciliation_last_success_timestamp_seconds > 27h. Do not push per-pod CPU metrics or per-request metrics through Pushgateway.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- What is the difference between an exporter and instrumenting your app directly? [Basic]
- What is PromQL, and what is an instant vector versus a range vector? [Basic]
- What is a scrape target, and how does service discovery find them? [Basic]
- What is the difference between rate() and irate()? [Basic]
- How does Prometheus collect metrics — what is the pull model and scraping? [Basic]
- How do you compute a 95th percentile latency from a histogram in PromQL (histogram_quantile)? [Basic]
- What is the difference between a counter and a gauge? [Basic]
- What is a recording rule, and when would you use one? [Basic]