# Lower flush\_interval for telegraf agent with prometheus

**URL:** https://community.influxdata.com/t/lower-flush-interval-for-telegraf-agent-with-prometheus/11105
**Category:** Telegraf
**Tags:** telegraf, prometheus, grafana
**Created:** [September 2, 2019, 11:13am UTC](https://community.influxdata.com/t/lower-flush-interval-for-telegraf-agent-with-prometheus/11105 "2019-09-02T11:13:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tarunchabarwal](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/tarunchabarwal/32/3574_2.png) [@tarunchabarwal](https://community.influxdata.com/u/tarunchabarwal)
#### Post date: [September 2, 2019, 11:13am UTC](https://community.influxdata.com/t/lower-flush-interval-for-telegraf-agent-with-prometheus/11105/1 "2019-09-02T11:13:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tarunchabarwal](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/tarunchabarwal/32/3574_2.png) [@tarunchabarwal](https://community.influxdata.com/u/tarunchabarwal)
#### Post date: [September 2, 2019, 11:36am UTC](https://community.influxdata.com/t/lower-flush-interval-for-telegraf-agent-with-prometheus/11105/2 "2019-09-02T11:36:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![MarcV](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/marcv/32/7676_2.png) [@MarcV](https://community.influxdata.com/u/MarcV)
#### Post date: [September 3, 2019, 2:24pm UTC](https://community.influxdata.com/t/lower-flush-interval-for-telegraf-agent-with-prometheus/11105/3 "2019-09-03T14:24:27Z")

</div>

Hi @tarunchabarwal welcome to the community ,

you can use the flush\_interval on [output plugin level](https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#output-plugins) ,  
maybe that is a solution for you combined with setting the interval on [input plugins](https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#input-plugins) level ?

best regards
