CloudMonitoring: Ensure variables can be used in all variable queries (#86377)

* Allow specifying project when querying services

* Ensure metricType is interpolated
pull/86645/head
Andreas Christou 2 years ago committed by GitHub
parent d6e84dbf0a
commit d8a8db3750
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      public/app/plugins/datasource/cloud-monitoring/components/VariableQueryEditor.tsx
  2. 2
      public/app/plugins/datasource/cloud-monitoring/datasource.ts

@ -160,7 +160,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
async onMetricTypeChange(metricType: string) {
const state = {
selectedMetricType: metricType,
...(await this.getLabels(metricType, this.state.projectName)),
...(await this.getLabels(getTemplateSrv().replace(metricType), this.state.projectName)),
};
this.setState(state, () => this.onPropsChange());
}
@ -278,6 +278,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
/>
</>
);
case MetricFindQueryTypes.Services:
case MetricFindQueryTypes.SLOServices:
return (
<>

@ -108,7 +108,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
crossSeriesReducer: aggregation?.crossSeriesReducer ?? 'REDUCE_NONE',
view: 'HEADERS',
},
metricType
this.templateSrv.replace(metricType)
),
},
],

Loading…
Cancel
Save