-
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
Update elastic-agent-system-metrics to v0.8.1 #37027
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
835ffda
to
400013d
Compare
68c679d
to
f2a282a
Compare
Update elastic-agent-system-metrics to v0.8.0 to enable collecting memory and CPU metrics from privileged process on Windows.
Update elastic-agent-system-metrics to v0.8.1 to enable collecting memory and CPU metrics from privileged process on Windows.
e29e2a6
to
3a08548
Compare
eecad32
to
b6e1465
Compare
Fix the python test to ensure the cmdLine is found in at least one process instead of them all because we cannot fetch the cmdLine from privileged process.
b6e1465
to
bab5bb4
Compare
# After iterating over all process, make sure at least one of them had | ||
# the 'cmdline' set. | ||
self.assertTrue( | ||
found_cmdline, "cmdline not found in any process events") |
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.
@fearful-symmetry, could you do a sanity check on this last change? I believe it is ok to change, but I'd like a second opinion before merging.
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 looks like the assertTrue()
line was just moved out of the loop block to check for the cmdline globally? That seems fine, but wouldn't it require the last event to set found_cmdline |= "cmdline" in process
in order to pass? Maybe a counter that needs to be > 1 would work?
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 looks like the assertTrue() line was just moved out of the loop block to check for the cmdline globally?
Yes, that was my intent because it already does an OR
operation on itself. Being honest I was very confused by the assertTrue()
being inside the loop and having found_cmdline |= "cmdline" in process
.
beats/metricbeat/module/system/test_system.py
Lines 421 to 427 in bab5bb4
found_cmdline = False | |
for evt in output: | |
process = evt["system"]["process"] | |
# Not all process will have 'cmdline' due to permission issues, | |
# especially on Windows. Therefore we ensure at least some of | |
# them will have it. | |
found_cmdline |= "cmdline" in process |
but wouldn't it require the last event to set found_cmdline |= "cmdline" in process in order to pass?
That's an OR
operator, so as long as "cmdline" in process
returns True
at least once, then found_cmdline
will always be True
.
Update elastic-agent-system-metrics to v0.8.1 to enable collecting memory and CPU metrics from privileged process on Windows. Fix the python test to ensure the cmdLine is found in at least one process instead of them all because we cannot fetch the cmdLine from privileged process on Windows.
Proposed commit message
Update elastic-agent-system-metrics to v0.8.1 to enable collecting
memory and CPU metrics from privileged process on Windows.
Fix python test to ensure the
cmdLine
is found in at least oneprocess instead of them all because we cannot fetch the
cmdLine
fromprivileged process on Windows.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
elastic-agent-system-metrics
to the fixed version (PR: Fix CmdLine generation and caching elastic-agent-system-metrics#107)How to test this PR locally
elastic-endpoint.exe
contain CPU and memory metrics.Related issues
## Use casesScreenshots
## Logs