influxdata / influxdata/telegraf
Adding a "first" and "last" measurement option to the BasicStats aggregator
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
## Feature Request
Opening a feature request kicks off a discussion.
### Proposal:
Besides the current measurements, such as "min", "max" and "mean" I would like to have the "last" or "first" value out of each period being returned.
### Current behavior:
This is not available currently.
### Desired behavior:
Be able to specify that the "first" and/or "last" value out of all measurements in every "period" of seconds is returned out of a series of continuous measurements.
Note: the "Final" Aggregator does not work as required, as this only submits a " final" measurement if there are no measurements during a set timeout. This however does not work for continuous streams of measurements without interruptions/timeouts.
### Use case:
I have measurements published on Mosquito that I wish to monitor in real-time. So the input to telegraf/Mosquitto must not be throttled. For analysis however the measurements could be reduced from 1 sample per second to once per minute.
With this new feature this could be done in memory/Telegraf _before_ the data is written to Influx, which drastically reduces the number of writes to e.g. Influx.
Contributor guide
Research direction
Start by locating the BasicStats aggregator and reading how its existing min, max, and mean measurements are calculated over each period. Determine how continuous streams should produce first and last values without relying on the Final aggregator, then verify that both options return the expected measurement for every period.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100