diff --git a/public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts b/public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts index b3bff0f4753..b8132e06bae 100644 --- a/public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts +++ b/public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts @@ -100,6 +100,7 @@ export default class CloudMonitoringMetricFindQuery { return []; } const refId = 'handleLabelValuesQuery'; + // REDUCE_MEAN is needed so the groupBy is not ignored const labels = await this.datasource.getLabels(selectedMetricType, refId, projectName, { groupBys: [labelKey], crossSeriesReducer: 'REDUCE_MEAN', diff --git a/public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx b/public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx index 40a129cbb04..48fcf346bc7 100644 --- a/public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx +++ b/public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx @@ -66,7 +66,7 @@ function Editor({ useEffect(() => { if (projectName && metricType) { datasource - .getLabels(metricType, refId, projectName, { groupBys, crossSeriesReducer }) + .getLabels(metricType, refId, projectName) .then((labels) => setState((prevState) => ({ ...prevState, labels }))); } }, [datasource, groupBys, metricType, projectName, refId, crossSeriesReducer]);