Metricbeat's Elasticsearch index_summary
metricset requests far too many metrics #36019
Description
- Version: Many, including current
main
f75a2ed - Operating System: All
- Discuss Forum URL: N/A
- Steps to Reproduce: N/A
Today the Elasticsearch index_summary
metricset requests all stats, broken down by index, on every collection:
beats/metricbeat/module/elasticsearch/_meta/README.md
Lines 35 to 38 in f75a2ed
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 elastic/elasticsearch#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.