Fix error sending empty tag value in azure monitor output (#5083)

This commit is contained in:
Raphael Couto 2018-12-13 17:57:03 -02:00 committed by Daniel Nelson
parent 8526aa5c87
commit f794d5b08a
1 changed files with 4 additions and 0 deletions

View File

@ -340,6 +340,10 @@ func hashIDWithTagKeysOnly(m telegraf.Metric) uint64 {
h.Write([]byte(m.Name())) h.Write([]byte(m.Name()))
h.Write([]byte("\n")) h.Write([]byte("\n"))
for _, tag := range m.TagList() { for _, tag := range m.TagList() {
if tag.Key == "" || tag.Value == "" {
continue
}
h.Write([]byte(tag.Key)) h.Write([]byte(tag.Key))
h.Write([]byte("\n")) h.Write([]byte("\n"))
} }