From ec9167e9728e742adeda2f9ee8a3ebb7056b0601 Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Wed, 18 Mar 2020 16:18:48 -0400 Subject: [PATCH] Check if the datasource is of type loki using meta.id instead of name. (#22877) Signed-off-by: Cyril Tovena --- public/app/features/explore/state/actions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/app/features/explore/state/actions.ts b/public/app/features/explore/state/actions.ts index c1b72208cfb..b27c3dc4304 100644 --- a/public/app/features/explore/state/actions.ts +++ b/public/app/features/explore/state/actions.ts @@ -439,20 +439,21 @@ export const runQueries = (exploreId: ExploreId): ThunkResult => { stopQueryState(querySubscription); + const datasourceId = datasourceInstance.meta.id; + const queryOptions: QueryOptions = { minInterval, // maxDataPoints is used in: // Loki - used for logs streaming for buffer size, with undefined it falls back to datasource config if it supports that. // Elastic - limits the number of datapoints for the counts query and for logs it has hardcoded limit. // Influx - used to correctly display logs in graph - maxDataPoints: mode === ExploreMode.Logs && datasourceInstance.name === 'Loki' ? undefined : containerWidth, + maxDataPoints: mode === ExploreMode.Logs && datasourceId === 'loki' ? undefined : containerWidth, liveStreaming: live, showingGraph, showingTable, mode, }; - const datasourceId = datasourceInstance.meta.id; const datasourceName = exploreItemState.requestedDatasourceName; const transaction = buildQueryTransaction(queries, queryOptions, range, scanning);