-
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
Metricbeat fails to get information for protected processes under Windows #17314
Metricbeat fails to get information for protected processes under Windows #17314
Comments
Pinging @elastic/integrations (Team:Integrations) |
@adriansr How was metricbeat started on Windows? Is it running as a service or is it being executed directly? If being executed directly, can you provide how you are starting it? Administrator cmd? Administrator powershell? |
We have the same problem. Multiple processes are not getting indexed...
|
In short, we are using standard user-mode Windows 32 APIs to query information on process internals, and we are unable to perform operations on protected processes due to their higher level of security. Some references below offer detailed information on this, the access rights we use to query information (OpenProcess 32 api more precisely) look to be denied for protected processes. https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=2 We are also using the
Process Explorer also uses standard user-mode Windows APIs to query information so indeed, it would be interesting if it can collect the exact process information we are not able to. |
Thanks @narph for the info. It would be Nice if we would be able to Get cpu and memory info From protected processen to Get a complete picture imho. |
Is Metricbeat using go-sysinfo, gosigar, or some its own code to fetch process info? Metricbeat can probably be made more robust when encountering protected processes. Ideally it would fallback back to using I looked over the go-sysinfo library and made some notes.
|
Metricbeat is using the libbeat/metric code that uses gosigar. beats/libbeat/metric/system/process/process.go Lines 110 to 115 in da8bc7c
|
Hi! We're labeling this issue as |
+1 |
Thanks for that. I see two things we can fix.
|
Thanks @gabriellandau This week we had an issue with lsass.exe on a system and we missed it completely as Metricbeat cannot capture lsass.exe cpu usage... |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
FYI I've seen another customer come in with questions about why they aren't getting metric data about Endpoint that would have been solved/prevented by resolving this issue. |
The error message from the description is not logged anymore due to removal in #30076 (perhaps by mistake). We should put it back while fixing this issue. |
It's better to ask @pierrehilbert about estimations. |
After some investigation and discussion with the team, my current plan for this task is:
|
## What does this PR do? It improves metric collection on Windows hosts so we can collect some metrics from privileged process like Elastic Endpoint or Elastic-Agent. In order to achieve that metrics collection for Windows are grouped by the access level required to collect metrics. First the metrics that can be collected with `PROCESS_QUERY_LIMITED_INFORMATION` are collected, then the others are collected. In case the second batch fails, we still report the partial metrics. ## Why is it important? It allows us to collect CPU and memory metrics from Endpoint and Elastic-Agent, which improves our monitoring dashboards. ## Related issues - Closes elastic/beats#17314
Reopening, let's not close this until the system metrics dependency is updated in Beats and Agent. |
Issue
For confirmed bugs, please report:
When running the system metricset, the debug log is filled with messages like:
We would like to understand if there are some permissions missing for Metricbeat.exe that could allow to fetch information from all or most of the processes that are currently failing. It would be good to compare with Process Explorer which can list this information for all processes.
Definition of done
The text was updated successfully, but these errors were encountered: