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

Question:
What is the difference between the delta() and deriv() functions in PromQL?

  1. delta() calculates the overall change in a metric over a time range, while deriv() calculates the rate of change over a time range
  2. deriv() calculates the overall change in a metric over a time range, while delta() calculates the rate of change over a time range
  3. delta() and deriv() are interchangeable and produce the same result
  4. delta() is used for counters, while deriv() is used for gauges
Answer:
A - The delta() function calculates the difference between the last value of the provided time series vector and the value of the vector at a certain time in the past
The deriv() function calculates the per-second derivative of the provided time series vector over a given time range
The delta() function is useful for calculating the total increase in a counter over a given time period