PCA (Prometheus Certified Associate) sample exam question with answer 533
Question:
Which of the following Prometheus instrumentation methods should be used for ingesting metrics about short-lived batch jobs?
- Create a long-lived exporter to retrieve the metrics whenever the job finishes, expose via push to Prometheus Pushgateway
- Create a long-lived exporter to retrieve the metrics whenever the job finishes, normal exposition
- Direct instrumentation, expose via push to Prometheus Pushgateway
- Direct instrumentation, normal exposition
Answer:
C - is the correct answer. More at
pushing
A - is incorrect as exporters are scraped by Prometheus, they do not push metrics to Pushgateway
B - is incorrect as Prometheus Pushgateway is ideal for the short-lived batch job use case. As with direct instrumentation, Prometheus may not be able to complete a scrape of the job by the time it finishes. By configuring a push of metrics to Pushgateway upon completion, we ensure all of the metrics will be ingested by Prometheus
D - is incorrect as Prometheus Pushgateway is ideal for the short-lived batch job use case. Consider Prometheus configured with a scrape interval of 1m where the batch job only runs for 30s. In this case, we'll perform one successful scrape half of the time and not successfully scrape the application at all the other half of the time (on average). By instrumenting the job to push its metrics to Pushgateway upon completion, we ensure that all metrics are accurate as of the end of the job every time it runs