From dede9e93cd1cd47eb350b9abef0322d42232f872 Mon Sep 17 00:00:00 2001 From: Loc Mai Date: Tue, 26 Oct 2021 03:52:47 +0700 Subject: [PATCH] Add search_query_current and indexing_index_current (#485) * Add search_query_current and indexing_index_current Signed-off-by: Loc Mai * update descriptions Signed-off-by: Loc Mai * Update collector/indices.go Co-authored-by: Ben Kochie Signed-off-by: Loc Mai * rename to current_indexed_docs Signed-off-by: Loc Mai * update docs Signed-off-by: Loc Mai * fix ordering Signed-off-by: Loc Mai * fix ordering Signed-off-by: Loc Mai * change back to index_current Signed-off-by: Loc Mai Co-authored-by: Ben Kochie --- README.md | 2 ++ collector/indices.go | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 81552bc2..1973e594 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Further Information | elasticsearch_filesystem_io_stats_device_write_operations_count | gauge | 1 | Count of disk write operations | elasticsearch_filesystem_io_stats_device_read_size_kilobytes_sum | gauge | 1 | Total kilobytes read from disk | elasticsearch_filesystem_io_stats_device_write_size_kilobytes_sum | gauge | 1 | Total kilobytes written to disk +| elasticsearch_indices_active_queries | gauge | 1 | The number of currently active queries | elasticsearch_indices_docs | gauge | 1 | Count of documents on this node | elasticsearch_indices_docs_deleted | gauge | 1 | Count of deleted documents on this node | elasticsearch_indices_docs_primary | gauge | | Count of documents with only primary shards on all nodes @@ -133,6 +134,7 @@ Further Information | elasticsearch_indices_get_total | counter | 1 | Total get | elasticsearch_indices_indexing_delete_time_seconds_total | counter | 1 | Total time indexing delete in seconds | elasticsearch_indices_indexing_delete_total | counter | 1 | Total indexing deletes +| elasticsearch_indices_index_current | gauge | 1 | The number of documents currently being indexed to an index | elasticsearch_indices_indexing_index_time_seconds_total | counter | 1 | Cumulative index time in seconds | elasticsearch_indices_indexing_index_total | counter | 1 | Total index calls | elasticsearch_indices_mappings_stats_fields | gauge | 1 | Count of fields currently mapped by index diff --git a/collector/indices.go b/collector/indices.go index 7133253b..1a4b0146 100644 --- a/collector/indices.go +++ b/collector/indices.go @@ -491,6 +491,18 @@ func NewIndices(logger log.Logger, client *http.Client, url *url.URL, shards boo }, Labels: indexLabels, }, + { + Type: prometheus.GaugeValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "search", "active_queries"), + "The number of currently active queries", + indexLabels.keys(), nil, + ), + Value: func(indexStats IndexStatsIndexResponse) float64 { + return float64(indexStats.Total.Search.QueryCurrent) + }, + Labels: indexLabels, + }, { Type: prometheus.CounterValue, Desc: prometheus.NewDesc( @@ -599,6 +611,18 @@ func NewIndices(logger log.Logger, client *http.Client, url *url.URL, shards boo }, Labels: indexLabels, }, + { + Type: prometheus.GaugeValue, + Desc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "index_stats", "index_current"), + "The number of documents currently being indexed to an index", + indexLabels.keys(), nil, + ), + Value: func(indexStats IndexStatsIndexResponse) float64 { + return float64(indexStats.Total.Indexing.IndexCurrent) + }, + Labels: indexLabels, + }, { Type: prometheus.CounterValue, Desc: prometheus.NewDesc(