Commit 62b103b8 by Kyle Brandt Committed by GitHub

Azuremonitor: do not set unit if literal "Unspecified" (#26839)

part of #26828
parent 8107e735
...@@ -293,9 +293,11 @@ func (e *AzureMonitorDatasource) parseResponse(queryRes *tsdb.QueryResult, amr A ...@@ -293,9 +293,11 @@ func (e *AzureMonitorDatasource) parseResponse(queryRes *tsdb.QueryResult, amr A
dataField := frame.Fields[1] dataField := frame.Fields[1]
dataField.Name = amr.Value[0].Name.LocalizedValue dataField.Name = amr.Value[0].Name.LocalizedValue
dataField.Labels = labels dataField.Labels = labels
if amr.Value[0].Unit != "Unspecified" {
dataField.SetConfig(&data.FieldConfig{ dataField.SetConfig(&data.FieldConfig{
Unit: toGrafanaUnit(amr.Value[0].Unit), Unit: toGrafanaUnit(amr.Value[0].Unit),
}) })
}
if query.Alias != "" { if query.Alias != "" {
dataField.Config.DisplayName = formatAzureMonitorLegendKey(query.Alias, query.UrlComponents["resourceName"], dataField.Config.DisplayName = formatAzureMonitorLegendKey(query.Alias, query.UrlComponents["resourceName"],
amr.Value[0].Name.LocalizedValue, "", "", amr.Namespace, amr.Value[0].ID, labels) amr.Value[0].Name.LocalizedValue, "", "", amr.Namespace, amr.Value[0].ID, labels)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment