[v11.1.x] CloudWatch: Fix raw queries with dimensions set (#90387)

CloudWatch: Fix raw queries with dimensions set (#90348)

(cherry picked from commit 9a8be1785a)

Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-07-12 17:33:49 -04:00
committed by GitHub
co-authored by Isabella Siu
parent af1aaab3a6
commit e0dbd8f3f2
2 changed files with 45 additions and 1 deletions
+6
View File
@@ -110,6 +110,12 @@ func parseLabels(cloudwatchLabel string, query *models.CloudWatchQuery) (string,
// set Series to the name of the time series as a fallback
labels := data.Labels{"Series": name}
// do not parse labels for raw queries
if query.MetricEditorMode == models.MetricEditorModeRaw {
return name, labels
}
for _, dim := range dims {
values := query.Dimensions[dim]
if isSingleValue(values) {