parent
2f7da03cce
commit
4bcf157d88
|
@ -24,6 +24,7 @@ for more details.
|
||||||
only. Previously there was an undocumented behavior where filters would match
|
only. Previously there was an undocumented behavior where filters would match
|
||||||
based on _prefix_ in addition to globs. This means that a filter like
|
based on _prefix_ in addition to globs. This means that a filter like
|
||||||
`fielddrop = ["time_"]` will need to be changed to `fielddrop = ["time_*"]`
|
`fielddrop = ["time_"]` will need to be changed to `fielddrop = ["time_*"]`
|
||||||
|
- **datadog**: measurement and field names will no longer have `_` replaced by `.`
|
||||||
- The following plugins have changed their tags to _not_ overwrite the host tag:
|
- The following plugins have changed their tags to _not_ overwrite the host tag:
|
||||||
- cassandra: `host -> cassandra_host`
|
- cassandra: `host -> cassandra_host`
|
||||||
- disque: `host -> disque_host`
|
- disque: `host -> disque_host`
|
||||||
|
@ -42,6 +43,7 @@ based on _prefix_ in addition to globs. This means that a filter like
|
||||||
- [#921](https://github.com/influxdata/telegraf/pull/921): mqtt_consumer stops gathering metrics. Thanks @chaton78!
|
- [#921](https://github.com/influxdata/telegraf/pull/921): mqtt_consumer stops gathering metrics. Thanks @chaton78!
|
||||||
- [#1013](https://github.com/influxdata/telegraf/pull/1013): Close dead riemann output connections. Thanks @echupriyanov!
|
- [#1013](https://github.com/influxdata/telegraf/pull/1013): Close dead riemann output connections. Thanks @echupriyanov!
|
||||||
- [#1012](https://github.com/influxdata/telegraf/pull/1012): Set default tags in test accumulator.
|
- [#1012](https://github.com/influxdata/telegraf/pull/1012): Set default tags in test accumulator.
|
||||||
|
- [#1024](https://github.com/influxdata/telegraf/issues/1024): Don't replace `.` with `_` in datadog output.
|
||||||
- [#1058](https://github.com/influxdata/telegraf/issues/1058): Fix possible leaky TCP connections in influxdb output.
|
- [#1058](https://github.com/influxdata/telegraf/issues/1058): Fix possible leaky TCP connections in influxdb output.
|
||||||
- [#1044](https://github.com/influxdata/telegraf/pull/1044): Fix SNMP OID possible collisions. Thanks @relip
|
- [#1044](https://github.com/influxdata/telegraf/pull/1044): Fix SNMP OID possible collisions. Thanks @relip
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/internal"
|
"github.com/influxdata/telegraf/internal"
|
||||||
|
@ -71,21 +70,22 @@ func (d *Datadog) Write(metrics []telegraf.Metric) error {
|
||||||
metricCounter := 0
|
metricCounter := 0
|
||||||
|
|
||||||
for _, m := range metrics {
|
for _, m := range metrics {
|
||||||
mname := strings.Replace(m.Name(), "_", ".", -1)
|
|
||||||
if dogMs, err := buildMetrics(m); err == nil {
|
if dogMs, err := buildMetrics(m); err == nil {
|
||||||
for fieldName, dogM := range dogMs {
|
for fieldName, dogM := range dogMs {
|
||||||
// name of the datadog measurement
|
// name of the datadog measurement
|
||||||
var dname string
|
var dname string
|
||||||
if fieldName == "value" {
|
if fieldName == "value" {
|
||||||
// adding .value seems redundant here
|
// adding .value seems redundant here
|
||||||
dname = mname
|
dname = m.Name()
|
||||||
} else {
|
} else {
|
||||||
dname = mname + "." + strings.Replace(fieldName, "_", ".", -1)
|
dname = m.Name() + "." + fieldName
|
||||||
}
|
}
|
||||||
|
var host string
|
||||||
|
host, _ = m.Tags()["host"]
|
||||||
metric := &Metric{
|
metric := &Metric{
|
||||||
Metric: dname,
|
Metric: dname,
|
||||||
Tags: buildTags(m.Tags()),
|
Tags: buildTags(m.Tags()),
|
||||||
Host: m.Tags()["host"],
|
Host: host,
|
||||||
}
|
}
|
||||||
metric.Points[0] = dogM
|
metric.Points[0] = dogM
|
||||||
tempSeries = append(tempSeries, metric)
|
tempSeries = append(tempSeries, metric)
|
||||||
|
|
Loading…
Reference in New Issue