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

Conversation

consulthys
Copy link
Contributor

@consulthys consulthys commented Feb 26, 2025

Proposed commit message

This PR fixes the index_summary metric set of the elasticsearch module and makes sure to only request cluster-level indexing stats (i.e. primaries and total) and not index-level stats. Since the latter are not needed, the module should not request them as that creates unnecessary load on the master node and consumes CPU and network resources for nothing.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

There won't be any disruption as currently the index_summary metric set requests more info than needed. This PR is simply restricts the API call to only what is needed.

How to test this PR locally

  1. Run Metricbeat with the elasticsearch module and the index_summary metric set enabled

Related issues

Fixes #36019

@consulthys consulthys added enhancement Feature:Stack Monitoring Team:Monitoring Stack Monitoring team backport-8.x Automated backport to the 8.x branch with mergify backport-8.17 Automated backport with mergify backport-8.18 Automated backport to the 8.18 branch labels Feb 26, 2025
@consulthys consulthys self-assigned this Feb 26, 2025
@consulthys consulthys requested a review from a team as a code owner February 26, 2025 08:58
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Feb 26, 2025
@consulthys consulthys added the Module:elasticsearch Elasticsearch Beats modules label Feb 26, 2025
Copy link
Member

@pickypg pickypg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@consulthys consulthys merged commit 947233a into main Feb 26, 2025
33 checks passed
@consulthys consulthys deleted the 36019-stack-mon-index-summary branch February 26, 2025 16:33
mergify bot pushed a commit that referenced this pull request Feb 26, 2025
* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)
mergify bot pushed a commit that referenced this pull request Feb 26, 2025
* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)
mergify bot pushed a commit that referenced this pull request Feb 26, 2025
* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)
consulthys added a commit that referenced this pull request Feb 26, 2025
…) (#42917)

* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)

Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
consulthys added a commit that referenced this pull request Feb 26, 2025
…) (#42918)

* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)

Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
consulthys added a commit that referenced this pull request Feb 27, 2025
…) (#42919)

* Only fetch cluster-level index stats summary

* Only fetch cluster-level index stats summary (fix tests)

(cherry picked from commit 947233a)

Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.17 Automated backport with mergify backport-8.18 Automated backport to the 8.18 branch enhancement Feature:Stack Monitoring Module:elasticsearch Elasticsearch Beats modules Team:Monitoring Stack Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat's Elasticsearch index_summary metricset requests far too many metrics
2 participants