Skip to content

[Stack Monitoring] Only fetch cluster-level index stats summary #42901

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

Merged
merged 4 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- Continue collecting metrics even if the Cisco Meraki `getDeviceLicenses` operation fails. {pull}42397[42397]
- Fixed errors in the `elasticsearch.index` metricset when index settings are missing. {issue}42424[42424] {pull}42426[42426]
- Fixed panic caused by uninitialized meraki device wifi0 and wifi1 struct pointers in the device WiFi data fetching. {issue}42745[42745] {pull}42746[42746]
- Only fetch cluster-level index stats summary {issue}36019[36019] {pull}42901[42901]

*Osquerybeat*

Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/elasticsearch/_meta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Metricbeat will call the following Elasticsearch API endpoints corresponding to
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_index_recovery)

### index_summary
- `/_stats`
- `/_stats?level=cluster`
- [api reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html)
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_index_summary)

Expand All @@ -48,7 +48,7 @@ Metricbeat will call the following Elasticsearch API endpoints corresponding to
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_node_2)

### node_stats
- `/_nodes/{_local|_all}/stats`
- `/_nodes/{_local|_all}/stats/jvm,indices,fs,os,process,transport,thread_pool,indexing_pressure,ingest/bulk,docs,get,merge,translog,fielddata,indexing,query_cache,request_cache,search,shard_stats,store,segments,refresh,flush`
- `_local` | `_all` from [`scope`](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-metricbeat.html#CO490-2) setting
- [api reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html)
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_node_stats)
Expand All @@ -59,4 +59,4 @@ Metricbeat will call the following Elasticsearch API endpoints corresponding to
### shard
- `/_cluster/state/version,nodes,master_node,routing_table`
- [api reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html)
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_shard)
- [mb exported fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_shard)
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func init() {
const (
statsPath = "/_stats"

allowClosedIndices = "forbid_closed_indices=false"
onlyClusterLevel = "level=cluster"
allowClosedIndices = "&forbid_closed_indices=false"
)

var (
Expand Down Expand Up @@ -109,6 +110,7 @@ func getServicePath(esVersion version.V) (string, error) {
return "", err
}

u.RawQuery += onlyClusterLevel
if !esVersion.LessThan(elasticsearch.BulkStatsAvailableVersion) {
u.RawQuery += allowClosedIndices
}
Expand Down
Loading