PCA practice question 9 of 15
Which metric type uses the delta() function?
Full set: 60 questionsThe delta() function in PromQL calculates the difference between the first and last value of each time series in a specified time range. This function is specifically designed for the Gauge metric type, which represents a numerical value that can arbitrarily go up and down, such as temperature or current memory usage. For example, delta(cputempcelsius[2h]) calculates how much the CPU temperature has changed over the last two hours. For Counter metrics, which only increase, the increase() function is the appropriate choice as it correctly handles counter resets.
A. Info: This is a synthetic metric type used to expose textual information; it is not a numerical time series and cannot be used with delta().
B. Histogram: This is a complex type for observing distributions. Its underlying components (sum, bucket) are counters, for which increase() is the correct function.
D. Counter: The increase() function should be used for counters as it is designed to handle resets gracefully, whereas delta() is not.
1. Prometheus Authors. (n.d.). Querying functions. Prometheus Documentation. Retrieved from https://prometheus.io/docs/prometheus/latest/querying/functions/#delta
Reference detail: The documentation explicitly states, "delta should only be used with gauges."
2. Prometheus Authors. (n.d.). Metric types. Prometheus Documentation. Retrieved from https://prometheus.io/docs/concepts/metrictypes/
Reference detail: This page defines the four metric types. It describes a Gauge as a value that "can arbitrarily go up and down," which aligns with the use case for delta(). It also specifies that for Counters, one should "use rate() to calculate the per-second average rate of increase," and by extension, increase() for the total increase.
Keep practicing
Take the free PCA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PCA practice questions
- Question 1What function calculates the tp-quantile from a histogram?
- Question 2How can you select all the up metrics whose instance label matches the regex fe-.*?
- Question 3Which exporter would be best suited for basic HTTP probing?
- Question 4What Prometheus component would you use if targets are running behind a Firewall/NAT?
- Question 5What is the name of the official *nix OS kernel metrics exporter?
- Question 6Which function would you use to calculate the 95th percentile latency from histogram data?
