CloudMonitoring: Fix resource labels in query editor (#44550)

pull/44740/head
Isabella Siu 3 years ago committed by GitHub
parent 4d1f3a3f6c
commit d3b8fc53aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      public/app/plugins/datasource/cloud-monitoring/CloudMonitoringMetricFindQuery.ts
  2. 2
      public/app/plugins/datasource/cloud-monitoring/components/MetricQueryEditor.tsx

@ -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',

@ -67,7 +67,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]);

Loading…
Cancel
Save