Which kind of metrics are associated with the function deriv()?
The deriv() function in PromQL calculates the per-second derivative of a time series using linear regression over the provided time range. It estimates the instantaneous rate of change for metrics that can both increase and decrease --- which are typically gauges.
Because counters can only increase (except when reset), rate() or increase() functions are more appropriate for them. deriv() is used to identify trends in fluctuating metrics like CPU temperature, memory utilization, or queue depth, where values rise and fall continuously.
In contrast, summaries and histograms consist of multiple sub-metrics (e.g., _count, _sum, _bucket) and are not directly suited for derivative calculation without decomposition.
Extracted and verified from Prometheus documentation -- PromQL Functions -- deriv(), Understanding Rates and Derivatives, and Gauge Metric Examples.
Currently there are no comments in this discussion, be the first to comment!