BasicStats Aggregator Plugin - Multiple aggregator periods and custom tags

#1

Hi All,
I am trying out Telegraf (v1.5.0), influxDB (v1.4.2) on Windows 10 Pro for the first time.
For our use case we need to aggregate data for mutiple intervals - hourly, daily, weekly, monthly, yearly etc.
So would like to know the best and efficient way to implement the same.

  1. Can I add multiple section for BasicStats Aggregator Plugin [[aggregators.basicstats]] ? How do I specify multiple period (hourly, daily etc) in the same configuration file ?
  2. or Should we use multiple instances of telegraf ? Is it possible to add custom tags (as per aggregator data interval) for each time series ?

Any help would be highly appreciated.
Thanks,
Arti

#2

To directly answer your questions, you can have multiple basicstats aggregators, each one can have different options and you can add tags if you like:

[[aggregators.basicstats]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  period = "30s"
  [aggregators.basicstats.tags]
    period = "30s"

[[aggregators.basicstats]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  period = "60s"

You may want to look over the examples the configuration documentation.

However, I don’t think this technique is suitable for such long time periods as a day, I would recommend using Kapacitor to do the aggregations after the raw values are stored in InfluxDB instead. This link should help you get started: https://docs.influxdata.com/kapacitor/v1.4/guides/continuous_queries/

#3

Thanks a lot for all your inputs… Let me test it.