Remove tags with empty values from Wavefront output (#4266)

(cherry picked from commit d2e729dfaf)
This commit is contained in:
Pierre Tessier 2018-06-11 17:54:08 -04:00 committed by Daniel Nelson
parent c7e5bbb25e
commit 3e56a3dcc9
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 8 additions and 0 deletions

View File

@ -180,6 +180,14 @@ func buildMetrics(m telegraf.Metric, w *Wavefront) []*MetricPoint {
}
func buildTags(mTags map[string]string, w *Wavefront) (string, map[string]string) {
// Remove all empty tags.
for k, v := range mTags {
if v == "" {
delete(mTags, k)
}
}
var source string
sourceTagFound := false