diff --git a/pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go b/pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go index 14203a85310..0411019e5e9 100644 --- a/pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go +++ b/pkg/tsdb/azuremonitor/metrics/azuremonitor-datasource.go @@ -424,10 +424,9 @@ func (e *AzureMonitorDatasource) parseResponse(amr types.AzureMonitorResponse, q resourceName = extractResourceNameFromMetricsURL(query.URL) resourceID = extractResourceIDFromMetricsURL(query.URL) } - if _, ok := labels[resourceIdLabel]; ok { - delete(labels, resourceIdLabel) - labels["resourceName"] = resourceName - } + + delete(labels, resourceIdLabel) + labels["resourceName"] = resourceName if query.Alias != "" { displayName := formatAzureMonitorLegendKey(query, resourceID, &amr, labels, subscription) diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/1-azure-monitor-response-avg.json.average-aggregate-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/1-azure-monitor-response-avg.json.average-aggregate-time-series-response.golden.jsonc index c456b44286d..440df0e1d00 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/1-azure-monitor-response-avg.json.average-aggregate-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/1-azure-monitor-response-avg.json.average-aggregate-time-series-response.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-08 10:13:00 +0000 UTC | 2.0875 | -// | 2019-02-08 10:14:00 +0000 UTC | 2.1525 | -// | 2019-02-08 10:15:00 +0000 UTC | 2.155 | -// | 2019-02-08 10:16:00 +0000 UTC | 3.6925 | -// | 2019-02-08 10:17:00 +0000 UTC | 2.44 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-08 10:13:00 +0000 UTC | 2.0875 | +// | 2019-02-08 10:14:00 +0000 UTC | 2.1525 | +// | 2019-02-08 10:15:00 +0000 UTC | 2.155 | +// | 2019-02-08 10:16:00 +0000 UTC | 3.6925 | +// | 2019-02-08 10:17:00 +0000 UTC | 2.44 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "unit": "percent", "links": [ diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.total-aggregate-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.total-aggregate-time-series-response.golden.jsonc index a2dad9ff76d..e9858ce8d30 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.total-aggregate-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.total-aggregate-time-series-response.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | -// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | -// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | -// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | -// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | +// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | +// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | +// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | +// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "unit": "percent", "links": [ diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-alias-patterns-in-the-query.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-alias-patterns-in-the-query.golden.jsonc index 9aa9a8f1e98..bdc7b29e4bc 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-alias-patterns-in-the-query.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-alias-patterns-in-the-query.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | -// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | -// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | -// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | -// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | +// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | +// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | +// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | +// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "displayName": "custom grafanastaging Microsoft.Compute/virtualMachines grafana Percentage CPU", "unit": "percent", diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-with-a-resource-uri-it-should-use-the-resource-uri.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-with-a-resource-uri-it-should-use-the-resource-uri.golden.jsonc index 9aa9a8f1e98..bdc7b29e4bc 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-with-a-resource-uri-it-should-use-the-resource-uri.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-with-a-resource-uri-it-should-use-the-resource-uri.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | -// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | -// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | -// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | -// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | +// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | +// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | +// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | +// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "displayName": "custom grafanastaging Microsoft.Compute/virtualMachines grafana Percentage CPU", "unit": "percent", diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-without-a-resource-uri.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-without-a-resource-uri.golden.jsonc index 9aa9a8f1e98..bdc7b29e4bc 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-without-a-resource-uri.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/2-azure-monitor-response-total.json.with-legacy-azure-monitor-query-properties-and-without-a-resource-uri.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | -// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | -// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | -// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | -// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 13:29:00 +0000 UTC | 8.26 | +// | 2019-02-09 13:30:00 +0000 UTC | 8.7 | +// | 2019-02-09 13:31:00 +0000 UTC | 14.82 | +// | 2019-02-09 13:32:00 +0000 UTC | 10.07 | +// | 2019-02-09 13:33:00 +0000 UTC | 8.52 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "displayName": "custom grafanastaging Microsoft.Compute/virtualMachines grafana Percentage CPU", "unit": "percent", diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/3-azure-monitor-response-maximum.json.maximum-aggregate-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/3-azure-monitor-response-maximum.json.maximum-aggregate-time-series-response.golden.jsonc index aea971bdc9f..4d1220b5048 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/3-azure-monitor-response-maximum.json.maximum-aggregate-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/3-azure-monitor-response-maximum.json.maximum-aggregate-time-series-response.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 14:26:00 +0000 UTC | 3.07 | -// | 2019-02-09 14:27:00 +0000 UTC | 2.92 | -// | 2019-02-09 14:28:00 +0000 UTC | 2.87 | -// | 2019-02-09 14:29:00 +0000 UTC | 2.27 | -// | 2019-02-09 14:30:00 +0000 UTC | 2.52 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 14:26:00 +0000 UTC | 3.07 | +// | 2019-02-09 14:27:00 +0000 UTC | 2.92 | +// | 2019-02-09 14:28:00 +0000 UTC | 2.87 | +// | 2019-02-09 14:29:00 +0000 UTC | 2.27 | +// | 2019-02-09 14:30:00 +0000 UTC | 2.52 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "unit": "percent", "links": [ diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/4-azure-monitor-response-minimum.json.minimum-aggregate-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/4-azure-monitor-response-minimum.json.minimum-aggregate-time-series-response.golden.jsonc index d22ef4b29cf..2cf986e640a 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/4-azure-monitor-response-minimum.json.minimum-aggregate-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/4-azure-monitor-response-minimum.json.minimum-aggregate-time-series-response.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 14:43:00 +0000 UTC | 1.51 | -// | 2019-02-09 14:44:00 +0000 UTC | 2.38 | -// | 2019-02-09 14:45:00 +0000 UTC | 1.69 | -// | 2019-02-09 14:46:00 +0000 UTC | 2.27 | -// | 2019-02-09 14:47:00 +0000 UTC | 1.96 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 14:43:00 +0000 UTC | 1.51 | +// | 2019-02-09 14:44:00 +0000 UTC | 2.38 | +// | 2019-02-09 14:45:00 +0000 UTC | 1.69 | +// | 2019-02-09 14:46:00 +0000 UTC | 2.27 | +// | 2019-02-09 14:47:00 +0000 UTC | 1.96 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "unit": "percent", "links": [ diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/5-azure-monitor-response-count.json.count-aggregate-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/5-azure-monitor-response-count.json.count-aggregate-time-series-response.golden.jsonc index 0a53b0297fa..ee3b2434e7d 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/5-azure-monitor-response-count.json.count-aggregate-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/5-azure-monitor-response-count.json.count-aggregate-time-series-response.golden.jsonc @@ -9,17 +9,17 @@ // } // Name: // Dimensions: 2 Fields by 5 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-09 14:44:00 +0000 UTC | 4 | -// | 2019-02-09 14:45:00 +0000 UTC | 4 | -// | 2019-02-09 14:46:00 +0000 UTC | 4 | -// | 2019-02-09 14:47:00 +0000 UTC | 4 | -// | 2019-02-09 14:48:00 +0000 UTC | 4 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-09 14:44:00 +0000 UTC | 4 | +// | 2019-02-09 14:45:00 +0000 UTC | 4 | +// | 2019-02-09 14:46:00 +0000 UTC | 4 | +// | 2019-02-09 14:47:00 +0000 UTC | 4 | +// | 2019-02-09 14:48:00 +0000 UTC | 4 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -59,7 +59,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "unit": "percent", "links": [ diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-time-series-response.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-time-series-response.golden.jsonc index e4975813359..facaf3712d1 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-time-series-response.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-time-series-response.golden.jsonc @@ -9,18 +9,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+---------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=PageBlob | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+---------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 3 | -// | 2019-02-09 16:21:00 +0000 UTC | 3 | -// | 2019-02-09 17:21:00 +0000 UTC | 3 | -// | 2019-02-09 18:21:00 +0000 UTC | 3 | -// | 2019-02-09 19:21:00 +0000 UTC | 3 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+---------------------------+ +// +-------------------------------+-------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=PageBlob, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+-------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 3 | +// | 2019-02-09 16:21:00 +0000 UTC | 3 | +// | 2019-02-09 17:21:00 +0000 UTC | 3 | +// | 2019-02-09 18:21:00 +0000 UTC | 3 | +// | 2019-02-09 19:21:00 +0000 UTC | 3 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+-------------------------------------------------+ // // // @@ -33,18 +33,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+----------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=BlockBlob | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 1 | -// | 2019-02-09 16:21:00 +0000 UTC | 1 | -// | 2019-02-09 17:21:00 +0000 UTC | 1 | -// | 2019-02-09 18:21:00 +0000 UTC | 1 | -// | 2019-02-09 19:21:00 +0000 UTC | 1 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+----------------------------+ +// +-------------------------------+--------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=BlockBlob, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+--------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 1 | +// | 2019-02-09 16:21:00 +0000 UTC | 1 | +// | 2019-02-09 17:21:00 +0000 UTC | 1 | +// | 2019-02-09 18:21:00 +0000 UTC | 1 | +// | 2019-02-09 19:21:00 +0000 UTC | 1 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+--------------------------------------------------+ // // // @@ -57,18 +57,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+------------------------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=Azure Data Lake Storage | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+------------------------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 0 | -// | 2019-02-09 16:21:00 +0000 UTC | 0 | -// | 2019-02-09 17:21:00 +0000 UTC | 0 | -// | 2019-02-09 18:21:00 +0000 UTC | 0 | -// | 2019-02-09 19:21:00 +0000 UTC | 0 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+------------------------------------------+ +// +-------------------------------+----------------------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=Azure Data Lake Storage, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+----------------------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 0 | +// | 2019-02-09 16:21:00 +0000 UTC | 0 | +// | 2019-02-09 17:21:00 +0000 UTC | 0 | +// | 2019-02-09 18:21:00 +0000 UTC | 0 | +// | 2019-02-09 19:21:00 +0000 UTC | 0 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+----------------------------------------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -109,7 +109,8 @@ "nullable": true }, "labels": { - "blobtype": "PageBlob" + "blobtype": "PageBlob", + "resourceName": "grafana" }, "config": { "unit": "short", @@ -179,7 +180,8 @@ "nullable": true }, "labels": { - "blobtype": "BlockBlob" + "blobtype": "BlockBlob", + "resourceName": "grafana" }, "config": { "unit": "short", @@ -249,7 +251,8 @@ "nullable": true }, "labels": { - "blobtype": "Azure Data Lake Storage" + "blobtype": "Azure Data Lake Storage", + "resourceName": "grafana" }, "config": { "unit": "short", diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-with-alias.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-with-alias.golden.jsonc index 3edc27cddde..550ea228564 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-with-alias.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/6-azure-monitor-response-single-dimension.json.single-dimension-with-alias.golden.jsonc @@ -9,18 +9,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+---------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=PageBlob | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+---------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 3 | -// | 2019-02-09 16:21:00 +0000 UTC | 3 | -// | 2019-02-09 17:21:00 +0000 UTC | 3 | -// | 2019-02-09 18:21:00 +0000 UTC | 3 | -// | 2019-02-09 19:21:00 +0000 UTC | 3 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+---------------------------+ +// +-------------------------------+-------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=PageBlob, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+-------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 3 | +// | 2019-02-09 16:21:00 +0000 UTC | 3 | +// | 2019-02-09 17:21:00 +0000 UTC | 3 | +// | 2019-02-09 18:21:00 +0000 UTC | 3 | +// | 2019-02-09 19:21:00 +0000 UTC | 3 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+-------------------------------------------------+ // // // @@ -33,18 +33,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+----------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=BlockBlob | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 1 | -// | 2019-02-09 16:21:00 +0000 UTC | 1 | -// | 2019-02-09 17:21:00 +0000 UTC | 1 | -// | 2019-02-09 18:21:00 +0000 UTC | 1 | -// | 2019-02-09 19:21:00 +0000 UTC | 1 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+----------------------------+ +// +-------------------------------+--------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=BlockBlob, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+--------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 1 | +// | 2019-02-09 16:21:00 +0000 UTC | 1 | +// | 2019-02-09 17:21:00 +0000 UTC | 1 | +// | 2019-02-09 18:21:00 +0000 UTC | 1 | +// | 2019-02-09 19:21:00 +0000 UTC | 1 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+--------------------------------------------------+ // // // @@ -57,18 +57,18 @@ // } // Name: // Dimensions: 2 Fields by 6 Rows -// +-------------------------------+------------------------------------------+ -// | Name: Time | Name: Blob Count | -// | Labels: | Labels: blobtype=Azure Data Lake Storage | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+------------------------------------------+ -// | 2019-02-09 15:21:00 +0000 UTC | 0 | -// | 2019-02-09 16:21:00 +0000 UTC | 0 | -// | 2019-02-09 17:21:00 +0000 UTC | 0 | -// | 2019-02-09 18:21:00 +0000 UTC | 0 | -// | 2019-02-09 19:21:00 +0000 UTC | 0 | -// | 2019-02-09 20:21:00 +0000 UTC | null | -// +-------------------------------+------------------------------------------+ +// +-------------------------------+----------------------------------------------------------------+ +// | Name: Time | Name: Blob Count | +// | Labels: | Labels: blobtype=Azure Data Lake Storage, resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+----------------------------------------------------------------+ +// | 2019-02-09 15:21:00 +0000 UTC | 0 | +// | 2019-02-09 16:21:00 +0000 UTC | 0 | +// | 2019-02-09 17:21:00 +0000 UTC | 0 | +// | 2019-02-09 18:21:00 +0000 UTC | 0 | +// | 2019-02-09 19:21:00 +0000 UTC | 0 | +// | 2019-02-09 20:21:00 +0000 UTC | null | +// +-------------------------------+----------------------------------------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -109,7 +109,8 @@ "nullable": true }, "labels": { - "blobtype": "PageBlob" + "blobtype": "PageBlob", + "resourceName": "grafana" }, "config": { "displayName": "blobtype=PageBlob", @@ -180,7 +181,8 @@ "nullable": true }, "labels": { - "blobtype": "BlockBlob" + "blobtype": "BlockBlob", + "resourceName": "grafana" }, "config": { "displayName": "blobtype=BlockBlob", @@ -251,7 +253,8 @@ "nullable": true }, "labels": { - "blobtype": "Azure Data Lake Storage" + "blobtype": "Azure Data Lake Storage", + "resourceName": "grafana" }, "config": { "displayName": "blobtype=Azure Data Lake Storage", diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/7-azure-monitor-response-multi-dimension.json.multiple-dimension-time-series-response-with-label-alias.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/7-azure-monitor-response-multi-dimension.json.multiple-dimension-time-series-response-with-label-alias.golden.jsonc index 21b577c92d4..eed3b980710 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/7-azure-monitor-response-multi-dimension.json.multiple-dimension-time-series-response-with-label-alias.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/7-azure-monitor-response-multi-dimension.json.multiple-dimension-time-series-response-with-label-alias.golden.jsonc @@ -9,15 +9,15 @@ // } // Name: // Dimensions: 2 Fields by 3 Rows -// +-------------------------------+------------------------------------------+ -// | Name: Time | Name: Blob Capacity | -// | Labels: | Labels: blobtype=PageBlob, tier=Standard | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+------------------------------------------+ -// | 2020-06-30 09:58:00 +0000 UTC | 675530 | -// | 2020-06-30 10:58:00 +0000 UTC | 675530 | -// | 2020-06-30 11:58:00 +0000 UTC | 675530 | -// +-------------------------------+------------------------------------------+ +// +-------------------------------+----------------------------------------------------------------+ +// | Name: Time | Name: Blob Capacity | +// | Labels: | Labels: blobtype=PageBlob, resourceName=default, tier=Standard | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+----------------------------------------------------------------+ +// | 2020-06-30 09:58:00 +0000 UTC | 675530 | +// | 2020-06-30 10:58:00 +0000 UTC | 675530 | +// | 2020-06-30 11:58:00 +0000 UTC | 675530 | +// +-------------------------------+----------------------------------------------------------------+ // // // @@ -30,15 +30,15 @@ // } // Name: // Dimensions: 2 Fields by 3 Rows -// +-------------------------------+--------------------------------------+ -// | Name: Time | Name: Blob Capacity | -// | Labels: | Labels: blobtype=BlockBlob, tier=Hot | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+--------------------------------------+ -// | 2020-06-30 09:58:00 +0000 UTC | 0 | -// | 2020-06-30 10:58:00 +0000 UTC | 0 | -// | 2020-06-30 11:58:00 +0000 UTC | 0 | -// +-------------------------------+--------------------------------------+ +// +-------------------------------+------------------------------------------------------------+ +// | Name: Time | Name: Blob Capacity | +// | Labels: | Labels: blobtype=BlockBlob, resourceName=default, tier=Hot | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------------------------------------+ +// | 2020-06-30 09:58:00 +0000 UTC | 0 | +// | 2020-06-30 10:58:00 +0000 UTC | 0 | +// | 2020-06-30 11:58:00 +0000 UTC | 0 | +// +-------------------------------+------------------------------------------------------------+ // // // @@ -51,15 +51,15 @@ // } // Name: // Dimensions: 2 Fields by 3 Rows -// +-------------------------------+-----------------------------------------------------+ -// | Name: Time | Name: Blob Capacity | -// | Labels: | Labels: blobtype=Azure Data Lake Storage, tier=Cool | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+-----------------------------------------------------+ -// | 2020-06-30 09:58:00 +0000 UTC | 0 | -// | 2020-06-30 10:58:00 +0000 UTC | 0 | -// | 2020-06-30 11:58:00 +0000 UTC | 0 | -// +-------------------------------+-----------------------------------------------------+ +// +-------------------------------+---------------------------------------------------------------------------+ +// | Name: Time | Name: Blob Capacity | +// | Labels: | Labels: blobtype=Azure Data Lake Storage, resourceName=default, tier=Cool | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+---------------------------------------------------------------------------+ +// | 2020-06-30 09:58:00 +0000 UTC | 0 | +// | 2020-06-30 10:58:00 +0000 UTC | 0 | +// | 2020-06-30 11:58:00 +0000 UTC | 0 | +// +-------------------------------+---------------------------------------------------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -101,6 +101,7 @@ }, "labels": { "blobtype": "PageBlob", + "resourceName": "default", "tier": "Standard" }, "config": { @@ -167,6 +168,7 @@ }, "labels": { "blobtype": "BlockBlob", + "resourceName": "default", "tier": "Hot" }, "config": { @@ -233,6 +235,7 @@ }, "labels": { "blobtype": "Azure Data Lake Storage", + "resourceName": "default", "tier": "Cool" }, "config": { diff --git a/pkg/tsdb/azuremonitor/testdata/azuremonitor/8-azure-monitor-response-unspecified-unit.json.unspecified-unit-with-alias-should-not-panic.golden.jsonc b/pkg/tsdb/azuremonitor/testdata/azuremonitor/8-azure-monitor-response-unspecified-unit.json.unspecified-unit-with-alias-should-not-panic.golden.jsonc index 4ab7576e666..10dfb991335 100644 --- a/pkg/tsdb/azuremonitor/testdata/azuremonitor/8-azure-monitor-response-unspecified-unit.json.unspecified-unit-with-alias-should-not-panic.golden.jsonc +++ b/pkg/tsdb/azuremonitor/testdata/azuremonitor/8-azure-monitor-response-unspecified-unit.json.unspecified-unit-with-alias-should-not-panic.golden.jsonc @@ -9,13 +9,13 @@ // } // Name: // Dimensions: 2 Fields by 1 Rows -// +-------------------------------+----------------------+ -// | Name: Time | Name: Percentage CPU | -// | Labels: | Labels: | -// | Type: []time.Time | Type: []*float64 | -// +-------------------------------+----------------------+ -// | 2019-02-08 10:13:00 +0000 UTC | 2.0875 | -// +-------------------------------+----------------------+ +// +-------------------------------+------------------------------+ +// | Name: Time | Name: Percentage CPU | +// | Labels: | Labels: resourceName=grafana | +// | Type: []time.Time | Type: []*float64 | +// +-------------------------------+------------------------------+ +// | 2019-02-08 10:13:00 +0000 UTC | 2.0875 | +// +-------------------------------+------------------------------+ // // // 🌟 This was machine generated. Do not edit. 🌟 @@ -55,7 +55,9 @@ "frame": "float64", "nullable": true }, - "labels": {}, + "labels": { + "resourceName": "grafana" + }, "config": { "displayName": "custom", "links": [