From e15ff49ea9b12ed576fa1de5c92d0c39c1781485 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Thu, 28 Jan 2016 13:23:19 -0700 Subject: [PATCH] Warn when metrics are being overwritten closes #601 --- CHANGELOG.md | 1 + internal/models/running_output.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cccefdeea..e86c388bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features - [#564](https://github.com/influxdata/telegraf/issues/564): features for plugin writing simplification. Internal metric data type. - [#603](https://github.com/influxdata/telegraf/pull/603): Aggregate statsd timing measurements into fields. Thanks @marcinbunsch! +- [#601](https://github.com/influxdata/telegraf/issues/601): Warn when overwriting cached metrics. ### Bugfixes - [#595](https://github.com/influxdata/telegraf/issues/595): graphite output should include tags to separate duplicate measurements. diff --git a/internal/models/running_output.go b/internal/models/running_output.go index 6d985fb4f..49a01f8ee 100644 --- a/internal/models/running_output.go +++ b/internal/models/running_output.go @@ -45,6 +45,9 @@ func (ro *RunningOutput) AddPoint(point telegraf.Metric) { if len(ro.metrics) < ro.PointBufferLimit { ro.metrics = append(ro.metrics, point) } else { + log.Printf("WARNING: overwriting cached metrics, you may want to " + + "increase the metric_buffer_limit setting in your [agent] config " + + "if you do not wish to overwrite metrics.\n") if ro.overwriteCounter == len(ro.metrics) { ro.overwriteCounter = 0 }