-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
dynamically generate CPU counts for metrics #23154
dynamically generate CPU counts for metrics #23154
Conversation
Pinging @elastic/integrations (Team:Integrations) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
Test | Results |
---|---|
Failed | 0 |
Passed | 16974 |
Skipped | 1276 |
Total | 18250 |
@@ -52,6 +52,7 @@ The list below covers the major changes between 7.0.0-rc2 and master only. | |||
- Replace `ACKCount`, `ACKEvents`, and `ACKLastEvent` callbacks with `ACKHandler` and interface in `beat.ClientConfig`. {pull}19632[19632] | |||
- Remove global ACK handler support via `SetACKHandler` from publisher pipeline. {pull}19632[19632] | |||
- Make implementing `Close` required for `reader.Reader` interfaces. {pull}20455[20455] | |||
- Remove `NumCPU` as clients should update the CPU count on the fly in case of config changes in a VM. {pull}23154[23154] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we consider this a breaking change or bug fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a publicly exported variable, so technically a breaking fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it is a change in reporting, most users will not notice. Users that will notice have had wrong data. Let's call it a fix. How about: Fix CPU usage metrics on VMs with dynamic CPU assignment. ...
jenkins, test this |
/test |
* dynamically generate CPU counts for metrics * dynamic-numcpu * fix exported vars * clean up CPU code * fix CPU count in system/cpu * update load * add changelog * fix tests (cherry picked from commit 40aeeef)
Can you please add an entry to Changelog.next.asciidoc as well? The change is clearly a user-visible fix. |
What does this PR do?
This changes the behavior of the process and CPU libbeat metrics libraries so that we don't "store" CPU values, in the case of users running this inside VMs were CPU counts can change during runtime. I'm a tad worried about any potential performance impacts of hitting the
NumCPU
call, but unless it's serious, it might be better than coming up with something more sophisticated that refreshes the value everyn
minutes or something.Why is it important?
If users are running metricbeat inside a VM where logical CPUs can be changed live, metricbeat can report incorrect metrics.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues