diff --git a/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx index 384e055de0d..c5bc0641245 100644 --- a/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx +++ b/public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx @@ -143,6 +143,12 @@ export class StackdriverVariableQueryEditor extends PureComponent this.onPropsChange()); } + onPropsChange = () => { + const { metricDescriptors, labels, metricTypes, services, ...queryModel } = this.state; + const query = this.queryTypes.find(q => q.value === this.state.selectedQueryType); + this.props.onChange(queryModel, `Stackdriver - ${query.name}`); + }; + componentDidUpdate(prevProps: Readonly, prevState: Readonly) { const selectSLOServiceChanged = this.state.selectedSLOService !== prevState.selectedSLOService; if (