Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search_query_current and indexing_index_current #485

Merged
merged 8 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Further Information
| 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_indexing_index_time_seconds_total | counter | 1 | Cumulative index time in seconds
| elasticsearch_indices_indexing_index_current | counter | 1 | Current index calls
| elasticsearch_indices_indexing_index_total | counter | 1 | Total index calls
| elasticsearch_indices_mappings_stats_fields | gauge | 1 | Count of fields currently mapped by index
| elasticsearch_indices_mappings_stats_json_parse_failures_total | counter | 0 | Number of errors while parsing JSON
Expand All @@ -157,6 +158,7 @@ Further Information
| elasticsearch_indices_search_fetch_time_seconds | counter | 1 | Total search fetch time in seconds
| elasticsearch_indices_search_fetch_total | counter | 1 | Total number of fetches
| elasticsearch_indices_search_query_time_seconds | counter | 1 | Total search query time in seconds
| elasticsearch_indices_search_query_current | counter | 1 | Current number of queries
| elasticsearch_indices_search_query_total | counter | 1 | Total number of queries
| elasticsearch_indices_segments_count | gauge | 1 | Count of index segments on this node
| elasticsearch_indices_segments_memory_bytes | gauge | 1 | Current memory size of segments in bytes
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.CounterValue,
Desc: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "index_stats", "search_query_current"),
locmai marked this conversation as resolved.
Show resolved Hide resolved
"Current number of 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.CounterValue,
Desc: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "index_stats", "indexing_index_current"),
"Current indexing index count",
locmai marked this conversation as resolved.
Show resolved Hide resolved
indexLabels.keys(), nil,
),
Value: func(indexStats IndexStatsIndexResponse) float64 {
return float64(indexStats.Total.Indexing.IndexCurrent)
},
Labels: indexLabels,
},
{
Type: prometheus.CounterValue,
Desc: prometheus.NewDesc(
Expand Down