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

This commit is contained in:
Isabella Siu 2022-01-27 11:35:13 -05:00 committed by GitHub
parent 4d1f3a3f6c
commit d3b8fc53aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

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

View File

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