PCA (Prometheus Certified Associate) sample exam question with answer 524

Question:
You are instrumenting an HTTP API with Prometheus metrics. You want to be able to get the 99th percentile latency of requests handled by your API.
How should you accomplish this?

  1. Expose a summary metric with no configured quantiles, use PromQL to calculate the 99th percentile
  2. Calculate the 99th percentile within the application, expose as a gauge metric
  3. Calculate the 99th percentile within the application, expose as a latency metric
  4. Expose a histogram metric, use PromQL to calculate the 99th percentile
Answer:
D - is the correct answer. More at metric_types
A - is incorrect as PromQL cannot be used to calculate quantiles for summaries. Summary quantiles are defined and calculated on the client side by the instrumented application
B - is incorrect as it is a best practice to expose metrics in the most "raw" form possible and perform required calculations with PromQL
C - is incorrect as there is no metric type called latency. Additionally, it is a best practice to expose metrics in the most "raw" form possible and perform required calculations with PromQL