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

Question:
What is the difference between the rate() and irate() functions in PromQL?

  1. rate() calculates the overall rate of change over a time range, while irate() calculates the instant rate of change at the current time
  2. irate() calculates the overall rate of change over a time range, while rate() calculates the instant rate of change at the current time
  3. rate() and irate() are interchangeable and produce the same result
  4. rate() is used for counters, while irate() is used for gauges
Answer:
A - The rate() function calculates the per-second average rate of increase of the provided time series vector over a given time range.
The irate() function calculates the per-second rate of increase of the provided time series vector at the current time.
The irate() function is useful for alerting on sudden spikes in a metric.