Lower flush_interval for telegraf agent with prometheus

We’re using prometheus with telegraf.

Using telegraf with following configuration:

interval = “15s”
round_interval = true
flush_interval = “15s”

But there are some metrics whose values are not available in some of the intervals. The poll interval for prometheus is 15 seconds.

This is my understanding: round_interval = true => instructs input to work on clock cycle (00, 15, 30, 45) for above config

flush_interval is the time at which Go’s telegraf.Metric channel buffers are flushed.

Channels buffer size is 100 as per code(agent.go).

Now to encounter the issue, I wish to use flush_interval values to be 2s(frequently providing input data to output, 2s here). Is this the correct solution?

Is there any other implication in lowering flush_interval’s value ?

We’re also using statsd input plugin

I’ve reduced prometheus_output’s to 20 seconds, since prometheus server pull time is 15 seconds. We use statsd and there are some metrics where counts are less and too infrequent(once in 5 minutes), which resulted in 4 times counting of same event (with 60 seconds expiration interval).

But when I reduced this expiration_time, some other guages like cpu,free_mem started to disappear some of the times from prometheus_output http endpoint.

Hi @tarunchabarwal welcome to the community ,

you can use the flush_interval on output plugin level ,
maybe that is a solution for you combined with setting the interval on input plugins level ?

best regards