v.25.9New Feature

Aggregate functions timeSeriesChangesToGrid and timeSeriesResetsToGrid

Aggregate functions timeSeriesChangesToGrid and timeSeriesResetsToGrid. Behaves similarly to timeSeriesRateToGrid, accepting parameters for start timestamp, end timestamp, step, and look back window, as well as two arguments for the timestamps and values, but requiring at least 1 sample per window instead of 2. Calculates a PromQL changes/resets, counting the number of times the sample value changes or decreases in the specified window for each timestamp in the time grid defined by the parameters. The return type is Array(Nullable(Float64)). #86010 (Stephen Chi).
Introduces aggregate functions timeSeriesChangesToGrid and timeSeriesResetsToGrid that calculate the number of value changes or resets in a time series over a specified time grid.

Why it matters

These functions address the need to analyze time series data by counting how many times the sample values change or reset within defined windows, similar to PromQL's changes and resets functions. This helps users monitor fluctuations and resets in metrics efficiently, especially when working with irregular or sparse time series data.

How to use it

Use timeSeriesChangesToGrid and timeSeriesResetsToGrid by providing parameters for the start timestamp, end timestamp, step size, look-back window, and two arguments representing timestamps and their corresponding values. Unlike timeSeriesRateToGrid, these require at least one sample per window. The functions return an Array(Nullable(Float64)) representing counts for each time grid point.