From d835c19fcecf5277ebae580850d7ddaea28bc4c4 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Thu, 28 Jan 2016 11:28:33 -0700 Subject: [PATCH] Insert . between msrmnt and field name in datadog output fixes #600 --- CHANGELOG.md | 2 ++ plugins/outputs/datadog/datadog.go | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42ff2964c..cccefdeea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ - [#603](https://github.com/influxdata/telegraf/pull/603): Aggregate statsd timing measurements into fields. Thanks @marcinbunsch! ### Bugfixes +- [#595](https://github.com/influxdata/telegraf/issues/595): graphite output should include tags to separate duplicate measurements. - [#599](https://github.com/influxdata/telegraf/issues/599): datadog plugin tags not working. +- [#600](https://github.com/influxdata/telegraf/issues/600): datadog measurement/field name parsing is wrong. ## v0.10.1 [2016-01-27] diff --git a/plugins/outputs/datadog/datadog.go b/plugins/outputs/datadog/datadog.go index aa2cb4ca0..ac1e35917 100644 --- a/plugins/outputs/datadog/datadog.go +++ b/plugins/outputs/datadog/datadog.go @@ -74,8 +74,16 @@ func (d *Datadog) Write(metrics []telegraf.Metric) error { mname := strings.Replace(m.Name(), "_", ".", -1) if dogMs, err := buildMetrics(m); err == nil { for fieldName, dogM := range dogMs { + // name of the datadog measurement + var dname string + if fieldName == "value" { + // adding .value seems redundant here + dname = mname + } else { + dname = mname + "." + strings.Replace(fieldName, "_", ".", -1) + } metric := &Metric{ - Metric: mname + strings.Replace(fieldName, "_", ".", -1), + Metric: dname, Tags: buildTags(m.Tags()), Host: m.Tags()["host"], }