Telegraf round_interval option for each input plugin

Hi,
I am trying to time the polling properly with round_interval (thanks to good blog entry How to Time Your Data Collection with Telegraf Agent Settings | InfluxData), but I miss one information from the docs. Is it taking interval variable from the main agent ? Or is it taking it separately from each input plugin setting ?
I am asking because I want to setup 2 Telegraf pollers in HA setup, where I have multiple input plugins with different intervals configured per plugin, and I want to make sure that I get data precisely when I want in equal time intervals (which will be different per plugin).
For example:
Telegraf_poller1 would have 2 input plugins configured where the polling interval would be 4 minutes for plugin1 and 6 minutes for plugin2. Main agent interval is 1 minute
Telegraf_poller2 would have 2 input plugins configured where the polling interval would be 4 minutes and collection_offset 2 minutes for plugin1; for plugin2 interval 6 minutes and collection_offset 3 minutes. Main agent interval is 1 minute

In the end I would like to get metrics from plugin1 every 2 minutes and from plugin2 every 3 minutes, however I would like to avoid a situation where for plugin1 I get one data sample at 0 minutes time (from Telegraf_poller1), then next one on 1 minutes time (from Telegraf_poller2), then next one would arrive at 5 minutes time (from Telegraf_poller1), and next one at 6 minutes time (from Telegraf_poller2).

Round interval should apply to any interval set by the user. You can always try it with two simple plugins :wink:

From that blog post:

The interval setting can be set at the agent or plugin level. You would use it at the plugin level if one input should be run less or more often than others.

Meaning you can set the interval at the agent level, and all input plugins will run with each other at the same time. Or you can run plugins at different intervals by setting the interval at the plugin level.

Also keep in mind that the interval option does not apply to all plugins. Some plugins are what we call service plugins so they won’t collect on an interval, but collect as data is received.

1 Like

The interval setting can be set at the agent or plugin level. You would use it at the plugin level if one input should be run less or more often than others.

Not sure how I missed that. Thanks for clarification. I appreciate it.