Don't add tags with empty values to opentsdb output (#4751)
This commit is contained in:
parent
d70c80722d
commit
2e2e998ebd
|
@ -213,7 +213,10 @@ func (o *OpenTSDB) WriteTelnet(metrics []telegraf.Metric, u *url.URL) error {
|
||||||
func cleanTags(tags map[string]string) map[string]string {
|
func cleanTags(tags map[string]string) map[string]string {
|
||||||
tagSet := make(map[string]string, len(tags))
|
tagSet := make(map[string]string, len(tags))
|
||||||
for k, v := range tags {
|
for k, v := range tags {
|
||||||
tagSet[sanitize(k)] = sanitize(v)
|
val := sanitize(v)
|
||||||
|
if val != "" {
|
||||||
|
tagSet[sanitize(k)] = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return tagSet
|
return tagSet
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue