From c9e67140cc645304266a10958c6711c65b4d5478 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Wed, 24 Apr 2019 01:00:02 -0700 Subject: [PATCH] CloudWatch: Use default alias if there is no alias for metrics (#16732) Fixes #16605 (cherry picked from commit 89a01a680c5772a363dd624c0e4e49ebf397f862) --- pkg/tsdb/cloudwatch/cloudwatch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/tsdb/cloudwatch/cloudwatch.go b/pkg/tsdb/cloudwatch/cloudwatch.go index 6d68e6902e5..f6d023ce14c 100644 --- a/pkg/tsdb/cloudwatch/cloudwatch.go +++ b/pkg/tsdb/cloudwatch/cloudwatch.go @@ -546,6 +546,10 @@ func formatAlias(query *CloudWatchQuery, stat string, dimensions map[string]stri return in }) + if string(result) == "" { + return metricName + "_" + stat + } + return string(result) }