Skip to content

Commit

Permalink
Add search_query_current and indexing_index_current (#485)
Browse files Browse the repository at this point in the history
* Add search_query_current and indexing_index_current

Signed-off-by: Loc Mai <[email protected]>

* update descriptions

Signed-off-by: Loc Mai <[email protected]>

* Update collector/indices.go

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Loc Mai <[email protected]>

* rename to current_indexed_docs

Signed-off-by: Loc Mai <[email protected]>

* update docs

Signed-off-by: Loc Mai <[email protected]>

* fix ordering

Signed-off-by: Loc Mai <[email protected]>

* fix ordering

Signed-off-by: Loc Mai <[email protected]>

* change back to index_current

Signed-off-by: Loc Mai <[email protected]>

Co-authored-by: Ben Kochie <[email protected]>
  • Loading branch information
locmai and SuperQ authored Oct 25, 2021
1 parent 5b2e5c7 commit dede9e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 24 additions & 0 deletions collector/indices.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dede9e9

Please sign in to comment.