Grafana datasource: support multiple targets (#31495)

This commit is contained in:
Ryan McKinley
2021-02-25 22:50:15 -08:00
committed by GitHub
parent e13333fa86
commit f451695ea6

View File

@@ -11,7 +11,7 @@ import {
import { GrafanaQuery, GrafanaAnnotationQuery, GrafanaAnnotationType, GrafanaQueryType } from './types';
import { getBackendSrv, getTemplateSrv, toDataQueryResponse, getLiveMeasurementsObserver } from '@grafana/runtime';
import { Observable, of } from 'rxjs';
import { Observable, of, merge } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
let counter = 100;
@@ -51,8 +51,7 @@ export class GrafanaDatasource extends DataSourceApi<GrafanaQuery> {
return queries[0];
}
if (queries.length > 1) {
// HELP!!!
return queries[0];
return merge(...queries);
}
return of(); // nothing
}