mirror of
https://github.com/grafana/grafana.git
synced 2025-09-18 03:02:57 +08:00
CloudMonitoring: Ensure variables can be used in all variable queries (#86377)
* Allow specifying project when querying services * Ensure metricType is interpolated
This commit is contained in:
@ -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)
|
||||
),
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user