Skip to content

Commit

Permalink
Merge pull request #4 from puckpuck/wavefront-output
Browse files Browse the repository at this point in the history
Changed name of Wavefront source option to source_override
  • Loading branch information
ezeev authored Dec 13, 2016
2 parents cbec765 + 23d35c6 commit a00df0d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions plugins/outputs/wavefront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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


Expand Down
8 changes: 4 additions & 4 deletions plugins/outputs/wavefront/wavefront.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Wavefront struct {
SimpleFields bool
MetricSeparator string
ConvertPaths bool
UseRegex bool
SourceTags []string
UseRegex bool
SourceOverride []string
DebugAll bool
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/outputs/wavefront/wavefront_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]


###############################################################################
Expand Down

0 comments on commit a00df0d

Please sign in to comment.