-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix translate empty tag values #5083
Conversation
Also, don't forget to sign the CLA. |
I've already sign! Forgot to check! |
dimensionNames = append(dimensionNames, tag.Key) | ||
dimensionValues = append(dimensionValues, tag.Value) | ||
if value == "" { | ||
value = "<empty>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can dimensions be added with the value as the empty string instead of using a placeholder value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can't have empty strings at all, I'd like to try this instead:
diff --git a/plugins/outputs/azure_monitor/azure_monitor.go b/plugins/outputs/azure_monitor/azure_monitor.go
index 5c435ac0..1c933072 100644
--- a/plugins/outputs/azure_monitor/azure_monitor.go
+++ b/plugins/outputs/azure_monitor/azure_monitor.go
@@ -340,6 +340,9 @@ func hashIDWithTagKeysOnly(m telegraf.Metric) uint64 {
h.Write([]byte(m.Name()))
h.Write([]byte("\n"))
for _, tag := range m.TagList() {
+ if tag.Key == "" || tag.Value == "" {
+ continue
+ }
h.Write([]byte(tag.Key))
h.Write([]byte("\n"))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(cherry picked from commit f794d5b)
Fix for #5063
Required for all PRs: