influxdata / influxdata/influxdb3_plugins
request: Add moving average calculation type to downsampling plugin
@caterryan is already working on this.
Since Feb 2, 2026.
- Dominant language
- Python
- Stars
- 37
- Forks
- 24
- Avg merge
- 16h 16m
- Merged PRs (30d)
- 17
Description
# Add moving average calculation type to downsampling plugin
### Description:
Add support for a moving average calculation type in the downsampling plugin. This would allow users to compute rolling/sliding window averages over a configurable number of preceding rows.
### Example use case:
```
SELECT
time,
site_id,
AVG(metric_value) OVER (
PARTITION BY metric_name, site, region, zone, site_id, group_id
ORDER BY time
ROWS BETWEEN 4 PRECEDING AND CURRENT ROW
) AS 5_sec_moving_avg
FROM measurements
WHERE
$__timeFilter(time)
AND group_id IN (${group_id:singlequote})
AND asset_id LIKE (${asset_id:singlequote})
ORDER BY time ASC
```
## Requirements:
- New moving_avg calculation type alongside existing types (e.g. mean, sum, min, max)
- Configurable window size (number of preceding rows)
- Support for partition-by grouping on tag columns
- Results ordered by time
## Configuration example:
[[calculations]]
type = "moving_avg"
window_size = 5
field = "metric_value"
partition_by = ["metric_name", "site", "region", "zone"]
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.