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
Azuremonitor: do not set unit if literal "Unspecified" #26839
Conversation
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.
Maybe better is to have "Unspecified" return an empty string from toGrafanaUnit()?
I considered that, but does add a unit with a value of an empty string. While that property won't get sent to the frontend because of the json omitempty on the struct, I felt it was clearer to show that in that case we are not setting the unit. |
dataField.SetConfig(&data.FieldConfig{ | ||
Unit: toGrafanaUnit(amr.Value[0].Unit), | ||
}) | ||
} |
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.
in addition to this, what about adding a warning if unit is "unspecified"?
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.
Adding the unit is new, so I think of it more of a nice to have. So I would worry about making a thing that would be more likely to annoy the user than do anything useful. In particular since adding the unit has resulted in other issues that still need to be resolved ( #26831 )
When the unit returned from azure is
Unspecified
, then we do not add that to frame.part of #26828