CloudWatch Logs: If Grafana Live isn't enabled, don't use the Live Channel (#36358)

* If Live isn't enabled, don't use the Live Channel

* ..Import Config if you want to use it!
This commit is contained in:
Thomas Cave 2021-07-07 12:39:32 +01:00 committed by GitHub
parent a241f03167
commit 3e95c3826a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ import { CloudWatchLanguageProvider } from './language_provider';
import { VariableWithMultiSupport } from 'app/features/variables/types';
import { AwsUrl, encodeUrl } from './aws_url';
import { increasingInterval } from './utils/rxjs/increasingInterval';
import config from 'app/core/config';
const DS_QUERY_ENDPOINT = '/api/ds/query';
@ -126,8 +127,11 @@ export class CloudWatchDatasource extends DataSourceWithBackend<CloudWatchQuery,
const dataQueryResponses: Array<Observable<DataQueryResponse>> = [];
if (logQueries.length > 0) {
dataQueryResponses.push(this.handleLiveLogQueries(logQueries, options));
// dataQueryResponses.push(this.handleLogQueries(logQueries, options));
if (config.liveEnabled) {
dataQueryResponses.push(this.handleLiveLogQueries(logQueries, options));
} else {
dataQueryResponses.push(this.handleLogQueries(logQueries, options));
}
}
if (metricsQueries.length > 0) {