mirror of
https://github.com/grafana/grafana.git
synced 2025-09-18 18:32:53 +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) {
|
async onMetricTypeChange(metricType: string) {
|
||||||
const state = {
|
const state = {
|
||||||
selectedMetricType: metricType,
|
selectedMetricType: metricType,
|
||||||
...(await this.getLabels(metricType, this.state.projectName)),
|
...(await this.getLabels(getTemplateSrv().replace(metricType), this.state.projectName)),
|
||||||
};
|
};
|
||||||
this.setState(state, () => this.onPropsChange());
|
this.setState(state, () => this.onPropsChange());
|
||||||
}
|
}
|
||||||
@ -278,6 +278,7 @@ export class CloudMonitoringVariableQueryEditor extends PureComponent<Props, Var
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
case MetricFindQueryTypes.Services:
|
||||||
case MetricFindQueryTypes.SLOServices:
|
case MetricFindQueryTypes.SLOServices:
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -108,7 +108,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
|
|||||||
crossSeriesReducer: aggregation?.crossSeriesReducer ?? 'REDUCE_NONE',
|
crossSeriesReducer: aggregation?.crossSeriesReducer ?? 'REDUCE_NONE',
|
||||||
view: 'HEADERS',
|
view: 'HEADERS',
|
||||||
},
|
},
|
||||||
metricType
|
this.templateSrv.replace(metricType)
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user