From 9bd556438286ff38955ec26e98afe420ad16976f Mon Sep 17 00:00:00 2001 From: csalvador-nr <118179155+csalvador-nr@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:21:35 +0100 Subject: [PATCH 1/3] Update elasticsearch.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the `SELECT` clause from: Active Search Latency (ms)
 Get Requests Latency (ms)
 Failed Indexing Operations per Node (Filterable)
 Indexing Latency (ms)
 Index Refresh Latency (ms) Some of them were dividing UNITS/milliseconds. When the goal is to find the average time of each unit it should be MS/UNITS. Additionally, `host.hostname` was being used for FACET when those metrics resulted in inconsistent data. Switched to using `entity.name` for correct results. `capture()` is used to sanitise node names. --- .../elasticsearch.json | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/dashboards/elasticsearch-elasticsearch/elasticsearch.json b/dashboards/elasticsearch-elasticsearch/elasticsearch.json index bf3e1d2f01..21c1c72d24 100644 --- a/dashboards/elasticsearch-elasticsearch/elasticsearch.json +++ b/dashboards/elasticsearch-elasticsearch/elasticsearch.json @@ -332,10 +332,16 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearches) - earliest(elasticsearch.node.activeSearches))/(latest(elasticsearch.node.activeSearchesInMilliseconds) - earliest(elasticsearch.node.activeSearchesInMilliseconds)) FACET host.hostname TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearches) - earliest(elasticsearch.node.activeSearches))/sum(elasticsearch.node.activeSearchesInMilliseconds) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], + "nullValues": { + "nullValue": "zero" + }, "yAxisLeft" : { "zero" : false + }, + "units": { + "unit": "MS" } } }, { @@ -358,10 +364,16 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.get.totalGetRequests) - earliest(elasticsearch.node.get.totalGetRequests))/(latest(elasticsearch.node.get.timeGetRequestsInMilliseconds) - earliest(elasticsearch.node.get.timeGetRequestsInMilliseconds)) AS 'Total', (latest(elasticsearch.node.get.requestsDocumentExists) - earliest(elasticsearch.node.get.requestsDocumentExists))/(latest(elasticsearch.node.get.requestsDocumentExistsInMilliseconds) - earliest(elasticsearch.node.get.requestsDocumentExistsInMilliseconds)) AS 'Document Exists', (latest(elasticsearch.node.get.requestsDocumentMissing) - earliest(elasticsearch.node.get.requestsDocumentMissing))/(latest(elasticsearch.node.get.requestsDocumentMissingInMilliseconds) - earliest(elasticsearch.node.get.requestsDocumentMissingInMilliseconds)) AS 'Document Missing' FACET host.hostname TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.get.totalGetRequests) - earliest(elasticsearch.node.get.totalGetRequests)) / (latest(elasticsearch.node.get.timeGetRequestsInMilliseconds) - earliest(elasticsearch.node.get.timeGetRequestsInMilliseconds)) AS 'Total', (latest(elasticsearch.node.get.requestsDocumentExists) - earliest(elasticsearch.node.get.requestsDocumentExists)) / (latest(elasticsearch.node.get.requestsDocumentExistsInMilliseconds) - earliest(elasticsearch.node.get.requestsDocumentExistsInMilliseconds)) AS 'Document Exists', (latest(elasticsearch.node.get.requestsDocumentMissing) - earliest(elasticsearch.node.get.requestsDocumentMissing)) / (latest(elasticsearch.node.get.requestsDocumentMissingInMilliseconds) - earliest(elasticsearch.node.get.requestsDocumentMissingInMilliseconds)) AS 'Document Missing' FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], + "nullValues": { + "nullValue": "zero" + }, "yAxisLeft" : { "zero" : false + }, + "units": { + "unit": "MS" } } }, { @@ -382,7 +394,7 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT latest(elasticsearch.node.index.indexingOperationsFailed) - earliest(elasticsearch.node.index.indexingOperationsFailed) AS 'Failed Operations' FACET host.hostname" + "query" : "FROM Metric SELECT latest(elasticsearch.node.index.indexingOperationsFailed) - earliest(elasticsearch.node.index.indexingOperationsFailed) AS 'Failed Operations' FACET capture(entity.name, r'es-node:(?P.*)')" } ] } }, { @@ -405,7 +417,7 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.indexing.documentsIndexed) - earliest(elasticsearch.node.indexing.documentsIndexed))/(latest(elasticsearch.node.indexing.timeIndexingDocumentsInMilliseconds) - earliest(elasticsearch.node.indexing.timeIndexingDocumentsInMilliseconds)) FACET host.hostname TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.indexing.documentsIndexed) - earliest(elasticsearch.node.indexing.documentsIndexed))/(latest(elasticsearch.node.indexing.timeIndexingDocumentsInMilliseconds) - earliest(elasticsearch.node.indexing.timeIndexingDocumentsInMilliseconds)) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], "yAxisLeft" : { "zero" : false @@ -431,8 +443,11 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.merges.segmentMerges) - earliest(elasticsearch.node.merges.segmentMerges))/(latest(elasticsearch.node.merges.totalSegmentMergingInMilliseconds) - earliest(elasticsearch.node.merges.totalSegmentMergingInMilliseconds)) FACET host.hostname TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.merges.totalSegmentMergingInMilliseconds) - earliest(elasticsearch.node.merges.totalSegmentMergingInMilliseconds)) / (latest(elasticsearch.node.merges.segmentMerges) - earliest(elasticsearch.node.merges.segmentMerges)) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], + "nullValues": { + "nullValue": "zero" + }, "yAxisLeft" : { "zero" : false } @@ -457,12 +472,18 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.refresh.total) - earliest(elasticsearch.node.refresh.total))/(latest(elasticsearch.node.refresh.totalInMilliseconds) - earliest(elasticsearch.node.refresh.totalInMilliseconds)) FACET host.hostname TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.refresh.totalInMilliseconds) - earliest(elasticsearch.node.refresh.totalInMilliseconds))/(latest(elasticsearch.node.refresh.total) - earliest(elasticsearch.node.refresh.total)) FACET capture(entityName, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], + "nullValues": { + "nullValue": "zero" + }, "yAxisLeft" : { "zero" : false + }, + "units": { + "unit": "MS" } } } ] } ] -} \ No newline at end of file +} From b084c6a585927f0e4bbab2c6e055c6bbaa2aec2d Mon Sep 17 00:00:00 2001 From: csalvador-nr <118179155+csalvador-nr@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:29:29 +0100 Subject: [PATCH 2/3] fix elasticsearch.json --- dashboards/elasticsearch-elasticsearch/elasticsearch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/elasticsearch-elasticsearch/elasticsearch.json b/dashboards/elasticsearch-elasticsearch/elasticsearch.json index 21c1c72d24..c02eed1513 100644 --- a/dashboards/elasticsearch-elasticsearch/elasticsearch.json +++ b/dashboards/elasticsearch-elasticsearch/elasticsearch.json @@ -332,7 +332,7 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearches) - earliest(elasticsearch.node.activeSearches))/sum(elasticsearch.node.activeSearchesInMilliseconds) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearchesInMilliseconds) - earliest(elasticsearch.node.activeSearchesInMilliseconds))/average(elasticsearch.node.activeSearches) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], "nullValues": { "nullValue": "zero" From 9a1edc452384b667c9e281f72ed4c8feb3b03f6d Mon Sep 17 00:00:00 2001 From: csalvador-nr <118179155+csalvador-nr@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:31:32 +0100 Subject: [PATCH 3/3] change average to sum --- dashboards/elasticsearch-elasticsearch/elasticsearch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/elasticsearch-elasticsearch/elasticsearch.json b/dashboards/elasticsearch-elasticsearch/elasticsearch.json index c02eed1513..8b235b3748 100644 --- a/dashboards/elasticsearch-elasticsearch/elasticsearch.json +++ b/dashboards/elasticsearch-elasticsearch/elasticsearch.json @@ -332,7 +332,7 @@ }, "nrqlQueries" : [ { "accountId" : 0, - "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearchesInMilliseconds) - earliest(elasticsearch.node.activeSearchesInMilliseconds))/average(elasticsearch.node.activeSearches) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" + "query" : "FROM Metric SELECT (latest(elasticsearch.node.activeSearchesInMilliseconds) - earliest(elasticsearch.node.activeSearchesInMilliseconds))/sum(elasticsearch.node.activeSearches) FACET capture(entity.name, r'es-node:(?P.*)') TIMESERIES SINCE 1 WEEK AGO" } ], "nullValues": { "nullValue": "zero"