The two relevant config options for sending and collecting data are interval and flush_interval:
The interval determines how often telegraf will collect data. In this case, every 10 seconds, your telegraf will collect from your inputs.
The flush_interval is how often telegraf will send collected data to your output: InfluxDB.
In your scenario, to get more data, you will want to set the interval option to a smaller value (e.g., “1s”) to obtain more data. If collecting the data from your input takes too long, Telegraf will produce some errors about taking too long to collect data.
You will want to play with this setting and find a good value that consistently collects data at the right level of detail for your situation.
Thanks for your reply!
Ok but even with an inverval of 1-10 sec (whatever) the data should be available in 1 ms steps
(but of course send only every 10 sec as a package) ?
Only if the collecting takes too long. There could be missing data.
Because with an MQTT Broker and an interval of 10 sec it’s working that data is available every 1 ms.
Hi @Manfred,
I agree with you in its current guise the OPC UA client needs some work. As you have already discovered the client essentially polls the server on each interval. Telegraf was not built to poll at that frequency.
I will turn this into a feature request for the OPC-UA rewrite where we look to use a subscription model equivalent to our MQTT client. Essentially when a monitored tag changes state we also collect this state. Then we deliver these samples to your output plugin under the usual flush interval. There are a few other major changes we are looking to add in the rewrite which can be found here: OPC-UA input plugin roadmap · Issue #10062 · influxdata/telegraf · GitHub