CloudWatch: Add labels for Metric Query type queries (#85766)
* CloudWatch: Fix metric query with group by not being labelled in alerts * just use one key for the labels * not needed * unused function * add tests * pr comments * fetch dimensions to build labels for MetricQuery type queries * pr comments * group cache related tests and use fresh cache for non-cache related tests * don't cache empty values
This commit is contained in:
@@ -96,11 +96,20 @@ func (e *cloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, req *ba
|
||||
return err
|
||||
}
|
||||
|
||||
if !features.IsEnabled(ctx, features.FlagCloudWatchNewLabelParsing) {
|
||||
requestQueries, err = e.getDimensionValuesForWildcards(ctx, region, client, requestQueries, instance.tagValueCache, instance.Settings.GrafanaSettings.ListMetricsPageLimit)
|
||||
if err != nil {
|
||||
return err
|
||||
newLabelParsingEnabled := features.IsEnabled(ctx, features.FlagCloudWatchNewLabelParsing)
|
||||
requestQueries, err = e.getDimensionValuesForWildcards(ctx, region, client, requestQueries, instance.tagValueCache, instance.Settings.GrafanaSettings.ListMetricsPageLimit, func(q *models.CloudWatchQuery) bool {
|
||||
if q.MetricQueryType == models.MetricQueryTypeSearch && (q.MatchExact || newLabelParsingEnabled) {
|
||||
return true
|
||||
}
|
||||
|
||||
if q.MetricQueryType == models.MetricQueryTypeQuery && q.MetricEditorMode == models.MetricEditorModeRaw {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := e.parseResponse(ctx, startTime, endTime, mdo, requestQueries)
|
||||
|
||||
Reference in New Issue
Block a user