From 78fb879aa74637c1d6d000f96e43740b32d6b4f8 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Tue, 17 Mar 2020 18:39:08 -0700 Subject: [PATCH] Update readme and changelog --- CHANGELOG.md | 1 + README.md | 1 + plugins/processors/dedup/README.md | 19 +++++++++++++------ plugins/processors/dedup/dedup.go | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4eaddf20..5b7828bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ #### New Processors +- [dedup](/plugins/processors/dedup/README.md) - Contributed by @igomura - [template](/plugins/processors/template/README.md) - Contributed by @RobMalvern - [s2_geo](/plugins/processors/s2_geo/README.md) - Contributed by @alespour diff --git a/README.md b/README.md index cb0c2169b..d1c43ca47 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,7 @@ For documentation on the latest development code see the [documentation index][d * [clone](/plugins/processors/clone) * [converter](/plugins/processors/converter) * [date](/plugins/processors/date) +* [dedup](/plugins/processors/dedup) * [enum](/plugins/processors/enum) * [override](/plugins/processors/override) * [parser](/plugins/processors/parser) diff --git a/plugins/processors/dedup/README.md b/plugins/processors/dedup/README.md index 5e808bcd3..d0b516c27 100644 --- a/plugins/processors/dedup/README.md +++ b/plugins/processors/dedup/README.md @@ -1,11 +1,6 @@ # Dedup Processor Plugin -If a metric sends the same value over successive intervals, suppress sending -the same value to the TSD until this many seconds have elapsed. This helps -graphs over narrow time ranges still see timeseries with suppressed datapoints. - -This feature can be used to reduce traffic when metric's value does not change over -time while maintain proper precision when value gets changed rapidly +Filter metrics whose field values are exact repetitions of the previous values. ### Configuration @@ -15,3 +10,15 @@ time while maintain proper precision when value gets changed rapidly dedup_interval = "600s" ``` +### Example + +```diff +- cpu,cpu=cpu0 time_idle=42i,time_guest=1i +- cpu,cpu=cpu0 time_idle=42i,time_guest=2i +- cpu,cpu=cpu0 time_idle=42i,time_guest=2i +- cpu,cpu=cpu0 time_idle=44i,time_guest=2i +- cpu,cpu=cpu0 time_idle=44i,time_guest=2i ++ cpu,cpu=cpu0 time_idle=42i,time_guest=1i ++ cpu,cpu=cpu0 time_idle=42i,time_guest=2i ++ cpu,cpu=cpu0 time_idle=44i,time_guest=2i +``` diff --git a/plugins/processors/dedup/dedup.go b/plugins/processors/dedup/dedup.go index d3e04e070..9c737da15 100644 --- a/plugins/processors/dedup/dedup.go +++ b/plugins/processors/dedup/dedup.go @@ -24,7 +24,7 @@ func (d *Dedup) SampleConfig() string { } func (d *Dedup) Description() string { - return "Deduplicate repetitive metrics" + return "Drop metrics with repeating field values" } // Remove single item from slice @@ -73,7 +73,7 @@ func (d *Dedup) Apply(metrics ...telegraf.Metric) []telegraf.Metric { continue } - // For each filed compare value with the cached one + // For each field compare value with the cached one changed := false for _, f := range metric.FieldList() { if value, ok := m.GetField(f.Key); ok && value != f.Value {