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

Allow metricbeat to dynamically identify the number of cores instead of using runtime.NumCPU() #23523

Closed
marc-gr opened this issue Jan 15, 2021 · 5 comments
Labels
enhancement Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team

Comments

@marc-gr
Copy link
Contributor

marc-gr commented Jan 15, 2021

Describe the enhancement:

Currently metricbeat uses runtime.NumCPU() to grab the number of cores: https://github.com/elastic/beats/blob/master/metricbeat/module/system/cpu/data.go#L100

This has some limitations, since there are a bunch of situations where the reported number does not match the actual number of cores:

  • You modified the number of cores without restarting (either because you are using an hypervisor that allows hot addition or you enabled them at runtime)
  • You have some offline or disabled cores
  • You run the process with a more restrictive affinity (using taskset)
  • or you have isolated CPUs in the system

Describe a specific use case for the enhancement or feature:

If any of the above situations happen, we still want to report the real number of cores. A similar change was done for auditbeat here

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@urso urso added the Team:Integrations Label for the Integrations team label Jan 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@fearful-symmetry
Copy link
Contributor

Agreed, we need to do this differently, the sooner the better. Both lscpu and auditbeat pull from /sys/devices/system/cpu on linux, which is the way to go. Not sure about other platforms.

@botelastic
Copy link

botelastic bot commented Apr 7, 2022

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!

@botelastic botelastic bot added the Stalled label Apr 7, 2022
@fearful-symmetry
Copy link
Contributor

Closing, as we now no longer use the runtime libs for CPU info, and we're now actually looking at os-reported CPU config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

4 participants