diff --git a/plugins/outputs/wavefront/README.md b/plugins/outputs/wavefront/README.md index 3e9788c339c38..27e4566cd1c1d 100644 --- a/plugins/outputs/wavefront/README.md +++ b/plugins/outputs/wavefront/README.md @@ -48,7 +48,7 @@ The `use_regex` setting can be used to ensure all illegal characters are properl use_regex = false ## point tags to use as the source name for Wavefront (if none found, host will be used) - source_tags = ["hostname", "snmp_host", "node_host"] + source_override = ["hostname", "snmp_host", "node_host"] ## Print additional debug information requires debug = true at the agent level debug_all = false @@ -63,7 +63,7 @@ Parameters: MetricSeparator string ConvertPaths bool UseRegex bool - SourceTags string + SourceOverride string DebugAll bool * `prefix`: String to use as a prefix for all sent metrics. @@ -73,7 +73,7 @@ Parameters: * `metric_separator`: character to use to separate metric and field names. (default is `_`) * `convert_paths`: if true (default) will convert all `_` in metric and field names to `metric_seperator` * `use_regex`: if true (default is false) will use regex to ensure all illegal characters are converted to `-`. Regex is much slower than the default mode which will catch most illegal characters. Use with caution. -* `source_tags`: ordered list of point tags to use as the source name for Wavefront. Once a match a found that tag is used for that point. If no tags are found the host tag will be used. +* `source_override`: ordered list of point tags to use as the source name for Wavefront. Once a match is found, that tag is used as the source for that point. If no tags are found the host tag will be used. * `debug_all`: Will output additional debug information. Requires `debug = true` to be configured at the agent level diff --git a/plugins/outputs/wavefront/wavefront.go b/plugins/outputs/wavefront/wavefront.go index 1f20619f9c9b1..57e8c201529de 100644 --- a/plugins/outputs/wavefront/wavefront.go +++ b/plugins/outputs/wavefront/wavefront.go @@ -20,8 +20,8 @@ type Wavefront struct { SimpleFields bool MetricSeparator string ConvertPaths bool - UseRegex bool - SourceTags []string + UseRegex bool + SourceOverride []string DebugAll bool } @@ -64,7 +64,7 @@ var sampleConfig = ` #use_regex = false ## point tags to use as the source name for Wavefront (if none found, host will be used) - #source_tags = ["hostname", "snmp_host", "node_host"] + #source_override = ["hostname", "snmp_host", "node_host"] ## Print additional debug information requires debug = true at the agent level #debug_all = false @@ -131,7 +131,7 @@ func (w *Wavefront) Write(metrics []telegraf.Metric) error { func buildTags(mTags map[string]string, w *Wavefront) []string { sourceTagFound := false - for _, s := range w.SourceTags { + for _, s := range w.SourceOverride { for k, v := range mTags { if k == s { mTags["source"] = v diff --git a/plugins/outputs/wavefront/wavefront_test.go b/plugins/outputs/wavefront/wavefront_test.go index 09ac28bfd481d..a3b28387d3a31 100644 --- a/plugins/outputs/wavefront/wavefront_test.go +++ b/plugins/outputs/wavefront/wavefront_test.go @@ -23,7 +23,7 @@ func defaultWavefront() *Wavefront { func TestSourceTags(t *testing.T) { w := defaultWavefront() - w.SourceTags = []string{"snmp_host", "hostagent"} + w.SourceOverride = []string{"snmp_host", "hostagent"} var tagtests = []struct { ptIn map[string]string diff --git a/telegraf.conf b/telegraf.conf index c3d29ae5261e0..2216f069d110c 100644 --- a/telegraf.conf +++ b/telegraf.conf @@ -101,7 +101,7 @@ #use_regex = false ## point tags to use as the source name for Wavefront (if none found, host will be used) - #source_tags = ["hostname", "snmp_host", "node_host"] + #source_override = ["hostname", "snmp_host", "node_host"] ###############################################################################