Skip to main content
Since 1.3.0 Get the change in a counter over a time period. This is the simple delta, computed by subtracting the last seen value from the first, after accounting for resets.

Arguments

NameTypeDefaultRequiredDescription
summaryCounterSummary-A counter aggregated created using counter_agg

Returns

DOUBLE PRECISION: The change in the counter over the bucketed interval

Samples

Get the change in each counter over the entire time interval in table foo.
SELECT
    id,
    delta(summary)
FROM (
    SELECT
        id,
        counter_agg(ts, val) AS summary
    FROM foo
    GROUP BY id
) t