influxdata / influxdata/telegraf

Rolling window on aggregator sampling

Open
#18,049 2 comments 1 reaction 1 assignee View on GitHub

@srebhan is already working on this.

Since Dec 4, 2025.

feature request
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

If I have an input that has an ever increasing cumulative value, I want to use an aggregator (such as basicstats diff) in order to calculate the delta from the previous value retrieved by an input.

### Expected behavior

The aggregator utilizes a rolling window of measurements to calculate its results, defined by a variable on the aggregator level. The window size is defined by the period variable. Additionally, the aggregator will output data on every interval of the input, not just once every period.

ex. the input has a 10s interval, the aggregator has a 20s period and always keeps the last 2 values of the input measurement which makes the delta calculation feasible. The aggregator will output every 10s which is the input interval and not every 20s

### Actual behavior

The period variable on the aggregators works as a tumbling window. This means that for the diff and non_negative_diff functionality of basicstats, cannot capture all deltas.

Ex. The input has a 10s interval, the aggregator has a 20s period. The aggregator outputs every 20s and returns the delta of the last 10s of the period, which means it discards the first 10s of the period.

### Additional info

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.