diff --git a/public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts b/public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts index 92bff6b1e89..236adda6053 100644 --- a/public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts +++ b/public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts @@ -65,6 +65,12 @@ export class StackdriverAggregationCtrl { const newValue = this.aggOptions.find(o => o.value !== 'REDUCE_NONE'); this.target.aggregation.crossSeriesReducer = newValue ? newValue.value : ''; } + + if (this.target.aggregation.groupBys.length > 0) { + this.aggOptions = this.aggOptions.filter(o => o.value !== 'REDUCE_NONE'); + const newValue = this.aggOptions.find(o => o.value !== 'REDUCE_NONE'); + this.target.aggregation.crossSeriesReducer = newValue ? newValue.value : ''; + } } formatAlignmentText() { diff --git a/public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts b/public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts index 173c5b801f9..37625b559f0 100644 --- a/public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts +++ b/public/app/plugins/datasource/stackdriver/query_filter_ctrl.ts @@ -241,6 +241,7 @@ export class StackdriverFilterCtrl { this.target.aggregation.groupBys = this.groupBySegments.reduce(reducer, []); this.ensurePlusButton(this.groupBySegments); + this.$rootScope.$broadcast('metricTypeChanged'); this.$scope.refresh(); }