PCA PCA Exporters & Integrations 2 — Questions and Answers
Question 1: What is the Prometheus pushgateway used for?
- Pushing alerts to Alertmanager
- Accepting metrics pushed by short-lived jobs that cannot be scraped (Correct answer)
- Forwarding scrapes to remote storage
- Pushing configuration updates to Prometheus
Correct answer: Accepting metrics pushed by short-lived jobs that cannot be scraped
The Pushgateway is an intermediary that accepts metric pushes from batch jobs or ephemeral processes, holding them until Prometheus scrapes the gateway.
Question 2: What is a key drawback of using the Prometheus Pushgateway for all metrics?
- It does not support labels
- It cannot hold more than 100 series
- Metrics persist after the originating job ends, hiding job failures (Correct answer)
- It requires a separate TLS certificate per job
Correct answer: Metrics persist after the originating job ends, hiding job failures
Pushed metrics remain in the Pushgateway until explicitly deleted, so a failed or stale job may still appear healthy because its last metrics are still present.
Question 3: Which Prometheus client library method is used to push metrics to a Pushgateway in the Go client?
- push.New().Push() (Correct answer)
- prometheus.Push()
- push.Collectors().Add()
- pushgateway.Send()
Correct answer: push.New().Push()
The Go client's `push.New(url, job).Collector(c).Push()` chain sends a collector's metrics to the specified Pushgateway URL under the given job name.
Question 4: What label does the Pushgateway automatically add to all metrics to identify the originating job?
- instance
- job (Correct answer)
- pushed_by
- source
Correct answer: job
The Pushgateway uses the job name from the push URL path (`/metrics/job/<jobname>`) as the `job` label on all stored metrics.
Question 5: What HTTP method should a batch job use to delete its metrics from the Pushgateway after completion?
- GET /metrics/job/<name>
- POST /delete/job/<name>
- DELETE /metrics/job/<name> (Correct answer)
- PUT /metrics/job/<name>/clear
Correct answer: DELETE /metrics/job/<name>
Sending an HTTP DELETE to `/metrics/job/<jobname>` removes the metric group from the Pushgateway, preventing stale data from persisting.
Question 6: The `statsd_exporter` converts StatsD metrics to Prometheus format using which configuration file feature?
- scrape_configs mapping
- Mapping rules that translate StatsD metric names to Prometheus labels and names (Correct answer)
- PromQL transform rules
- Prometheus relabel_configs
Correct answer: Mapping rules that translate StatsD metric names to Prometheus labels and names
The statsd_exporter's mapping configuration translates dot-separated StatsD metric names into Prometheus metric names with proper labels using regex-based mapping rules.
What is the Prometheus pushgateway used for?