Skip to content

Commit

Permalink
Don't add tags with empty values to opentsdb output (#4751)
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton authored and danielnelson committed Sep 27, 2018
1 parent d70c807 commit 2e2e998
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/outputs/opentsdb/opentsdb.go
Expand Up @@ -213,7 +213,10 @@ func (o *OpenTSDB) WriteTelnet(metrics []telegraf.Metric, u *url.URL) error {
func cleanTags(tags map[string]string) map[string]string {
tagSet := make(map[string]string, len(tags))
for k, v := range tags {
tagSet[sanitize(k)] = sanitize(v)
val := sanitize(v)
if val != "" {
tagSet[sanitize(k)] = val
}
}
return tagSet
}
Expand Down

0 comments on commit 2e2e998

Please sign in to comment.