Use add time for prometheus expiration calculation (#7056)

This commit is contained in:
Daniel Nelson
2020-02-24 15:53:16 -08:00
committed by GitHub
parent e9e4f2c354
commit b5e0577d6b
4 changed files with 266 additions and 179 deletions

View File

@@ -83,7 +83,7 @@ func (c *Collector) Add(metrics []telegraf.Metric) error {
defer c.Unlock()
for _, metric := range metrics {
c.coll.Add(metric)
c.coll.Add(metric, time.Now())
}
// Expire metrics, doing this on Add ensure metrics are removed even if no