Azuremonitor: do not set unit if literal "Unspecified" #26839
Conversation
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), | ||
}) | ||
} |
papagian
Aug 6, 2020
Contributor
in addition to this, what about adding a warning if unit is "unspecified"?
in addition to this, what about adding a warning if unit is "unspecified"?
kylebrandt
Aug 6, 2020
Author
Contributor
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 )
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