elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.08k stars 4.89k forks source link

Metricbeat's Elasticsearch `index_summary` metricset requests far too many metrics #36019

Open DaveCTurner opened 1 year ago

DaveCTurner commented 1 year ago

Today the Elasticsearch index_summary metricset requests all stats, broken down by index, on every collection:

https://github.com/elastic/beats/blob/f75a2ed898bc883c451d6aab35cc60d17158f788/metricbeat/module/elasticsearch/_meta/README.md?plain=1#L35-L38

Metricbeat does not need all these stats, but Elasticsearch cannot know this so it must compute and return them all. Computing stats can be expensive in larger clusters, and returning them all burns network bandwidth as well as CPU on both sender and receiver, so it would be best to make this request as specific as possible. AIUI this metricset only needs the summary stats so should specify ?level=cluster to drop the index-by-index breakdown, and also it only needs a subset of the index metrics which it should specify.

Relates https://github.com/elastic/elasticsearch/issues/97222: it does not look like Metricbeat captures cluster-wide stats about the query cache, so it should drop the query_cache metric. TBC it is an ES bug that these stats in particular are so expensive, but this computation will never be free so it's still a MB bug to request them when they're not needed.

botelastic[bot] commented 1 year ago

This issue doesn't have a Team:<team> label.

botelastic[bot] commented 3 weeks ago

Hi! We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!