-
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
Add config option to disable or enable cmdline cache for System Process Metricset #3891
Add config option to disable or enable cmdline cache for System Process Metricset #3891
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
1 similar comment
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
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.
In general LGTM. I thinking if this cache should be emptied from time to time (timeout) or on / off is enough?
This metricset caches the command line args for a running process. This means if you alter | ||
the command line for a process while this metricset is running, these changes are not detected. | ||
This feature can disabled by adding | ||
`process.cmdline.cache: false` to the system module configuration. |
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.
We should add this option also to the full config file: https://github.com/elastic/beats/blob/master/metricbeat/module/system/_meta/config.full.yml (don't forget make update ;-) )
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 you mean to add an optional timeout config if cache is true
process.cmdline.cache: true
process.cmdline.timeout: 5m
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.
I was more thinking out loud. So far I don't think we had any requests for it so I would leave it out. But it is good to have it as a potential option for the future.
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.
When the PID disappears the cached cmdline for the PID is dropped. This is the current behavior.
Could you also update the changelog? |
Ok. Is the grammar of the description right? |
|
||
This metricset caches the command line args for a running process. This means if you alter | ||
the command line for a process while this metricset is running, these changes are not detected. | ||
This feature can disabled by adding |
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.
This feature can be disabled by adding
@maddin2016 Left one additional comment there. Would also like to get @andrewkroh opinion on the feature. |
The implementation LGTM. I have two questions.
|
@andrewkroh The nice part about having |
An other advantage of adding enabled is that in case we add a timeout in the future, |
Do you happen to know what API call an application needs to use to update its command line after starting? On Linux this is possible (I think via magic) and BSD has setproctitle. But I can't find anything about this for Win. |
See here
|
74d2be4
to
4b8d045
Compare
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.
LGTM, thanks for implementing this.
fixes #3799
This PR add a config option for the process metricset to disable or enable caching the commandline args for a process.