influxdata / influxdata/telegraf
Rolling window on aggregator sampling
@srebhan is already working on this.
Since Dec 4, 2025.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.