influxdata / influxdata/telegraf
Make "Merge" plugin work with aggregator results
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
## Feature Request
### Proposal:
The Merge plugin only works with raw input data, every 1 minute, it doesn't play nicely with aggregator outputs.
### Current behavior:
```
[agent]
collection_jitter = "0s"
[[inputs.cpu]]
percpu = false
totalcpu = true
collect_cpu_time = false
report_active = false
fieldpass = ["usage_idle"]
[[aggregators.quantile]]
period = "5s"
drop_original = true
quantiles = [0.95]
order = 1
[[aggregators.basicstats]]
drop_original = true
period = "5s"
stats = ["count", "rate", "sum"]
order = 2
[[aggregators.merge]]
drop_original = true
order = 3
fieldpass = ["usage_idle_*"]
```
Output:
```
cpu,cpu=cpu-total usage_idle_095=82.67260012136957 1637893260000000000
cpu,cpu=cpu-total usage_idle_count=5,usage_idle_sum=402.1946738461496,usage_idle_rate=0.28685386306114324 1637893260000000000
cpu,cpu=cpu-total usage_idle_count=5,usage_idle_sum=390.2688202755629,usage_idle_rate=-2.64097419767619 1637893265000000000
cpu,cpu=cpu-total usage_idle_095=83.12142252112594 1637893265000000000
```
You see the lines are with the same measurement, tags and timestamp but didn't merge.
From the debug log it looks like the merge works at different time window than `quantile` or `basicstats`.
### Desired behavior:
Merge aggregate results.
Contributor guide
Research direction
Reproduce the shown Telegraf configuration with the Merge, quantile, and basicstats aggregators, then inspect the Merge plugin's handling of aggregator output and time windows. Compare the emitted metric lines and debug timing; done means aggregate results with matching measurement, tags, and timestamp are merged as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- data, stream-processing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100