From a102ab2894e7a9ca6eee307aa9b60dfea169c718 Mon Sep 17 00:00:00 2001 From: Ivana Date: Wed, 15 Jul 2020 11:06:15 +0200 Subject: [PATCH] Revert "Remove _source just for metrics, not logs" This reverts commit 611b6922f762afa0e76fd8679a9b8160bca74e6a. --- .../datasource/elasticsearch/elastic_response.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/public/app/plugins/datasource/elasticsearch/elastic_response.ts b/public/app/plugins/datasource/elasticsearch/elastic_response.ts index 218ea4d23c5..447fede18ae 100644 --- a/public/app/plugins/datasource/elasticsearch/elastic_response.ts +++ b/public/app/plugins/datasource/elasticsearch/elastic_response.ts @@ -417,13 +417,7 @@ export class ElasticResponse { if (response.hits && response.hits.hits.length > 0) { const { propNames, docs } = flattenHits(response.hits.hits); if (docs.length > 0) { - const series = createEmptyDataFrame( - propNames, - this.targets[0].timeField, - isLogsRequest, - logMessageField, - logLevelField - ); + const series = createEmptyDataFrame(propNames, this.targets[0].timeField, logMessageField, logLevelField); // Add a row for each document for (const doc of docs) { @@ -560,7 +554,6 @@ const flattenHits = (hits: Doc[]): { docs: Array>; propNames const createEmptyDataFrame = ( propNames: string[], timeField: string, - isLogsRequest: boolean, logMessageField?: string, logLevelField?: string ): MutableDataFrame => { @@ -596,8 +589,8 @@ const createEmptyDataFrame = ( if (fieldNames.includes(propName)) { continue; } - // Do not add _source field (besides logs) as we are showing each _source field in table instead. - if (!isLogsRequest && propName === '_source') { + // Do not add _source field as we are showing each _source field in table instead. + if (propName === '_source') { continue; }