mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: adds null check to query
This commit is contained in:
parent
8b72853d36
commit
fa6e31c6d5
@ -12,15 +12,23 @@ export default class StackdriverDatasource {
|
||||
}
|
||||
|
||||
async getTimeSeries(options) {
|
||||
const queries = options.targets.filter(target => !target.hide).map(t => ({
|
||||
refId: t.refId,
|
||||
datasourceId: this.id,
|
||||
metricType: t.metricType,
|
||||
primaryAggregation: t.aggregation.crossSeriesReducer,
|
||||
groupBys: t.aggregation.groupBys,
|
||||
view: t.view || 'FULL',
|
||||
filters: t.filters,
|
||||
}));
|
||||
const queries = options.targets.filter(target => !target.hide).map(t => {
|
||||
if (!t.hasOwnProperty('aggregation')) {
|
||||
t.aggregation = {
|
||||
crossSeriesReducer: 'REDUCE_MEAN',
|
||||
groupBys: [],
|
||||
};
|
||||
}
|
||||
return {
|
||||
refId: t.refId,
|
||||
datasourceId: this.id,
|
||||
metricType: t.metricType,
|
||||
primaryAggregation: t.aggregation.crossSeriesReducer,
|
||||
groupBys: t.aggregation.groupBys,
|
||||
view: t.view || 'FULL',
|
||||
filters: t.filters,
|
||||
};
|
||||
});
|
||||
|
||||
const { data } = await this.backendSrv.datasourceRequest({
|
||||
url: '/api/tsdb/query',
|
||||
|
Loading…
Reference in New Issue
Block a user