Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert . between msrmnt and field name in datadog output
Browse files Browse the repository at this point in the history
fixes #600
sparrc committed Jan 28, 2016
1 parent 9d4b55b commit ea9745c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/outputs/datadog/datadog.go
Original file line number Diff line number Diff line change
@@ -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"],
}

0 comments on commit ea9745c

Please sign in to comment.