-
Notifications
You must be signed in to change notification settings - Fork 2.7k
hostmetrics: use WMI to fetch ppid #35337
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
Changes from all commits
d6c6b1c
6b4db51
ebf6fe0
1427e9b
ff7e77e
e628ed8
bb920e2
435ba82
5c274d2
acb81f8
0cec278
6e442b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: hostmetricsreceiver | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Use Windows Management Interface to fetch process.ppid by default. Add `disable_wmi` config option to fallback to old behaviour. | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [32947] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: This also made a change where the parent process ID will not be fetched if the resource attribute is disabled. | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [user] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,7 @@ process: | |
mute_process_io_error: <true|false> | ||
mute_process_user_error: <true|false> | ||
mute_process_cgroup_error: <true|false> | ||
wmi_enabled: <true|false> | ||
scrape_process_delay: <time> | ||
``` | ||
|
||
|
@@ -133,6 +134,19 @@ The following settings are optional: | |
- `mute_process_cgroup_error` (default: false): mute the error encountered when trying to read the cgroup of a process the collector does not have permission to read. This flag is ignored when `mute_process_all_errors` is set to true as all errors are muted. | ||
- `mute_process_exe_error` (default: false): mute the error encountered when trying to read the executable path of a process the collector does not have permission to read (Linux only). This flag is ignored when `mute_process_all_errors` is set to true as all errors are muted. | ||
- `mute_process_user_error` (default: false): mute the error encountered when trying to read a uid which doesn't exist on the system, eg. is owned by a user that only exists in a container. This flag is ignored when `mute_process_all_errors` is set to true as all errors are muted. | ||
- `wmi_enabled` (default: true): allow the scraper to use [Windows Management Instrumentation (WMI)](https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page) to fetch some information on Windows. This option has no effect on non-Windows environments. | ||
|
||
#### High CPU Usage On Windows | ||
|
||
Getting the Parent Process ID of all processes on Windows is a very expensive operation. There are two options to combat this: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still true after this change? Could you please collect the latest image capture of perfmon with the latest code? On my box:
So I rough approximation it will be a bit less than 2 milliseconds per process (I had 437 processes on my box). I will guess that not being on Powershell it should a bit cheaper. |
||
* Allow the collector to use WMI, this is the default behaviour with the `wmi_enabled` configuration option | ||
* Disable Parent Process ID collection like so: | ||
```yaml | ||
process: | ||
resource_attributes: | ||
process.parent_pid: | ||
enabled: false | ||
``` | ||
|
||
## Advanced Configuration | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
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.
The remaining of the PR references
wmi_enabled
instead ofdisable_wmi