-
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 environment variables to the system process metricset #3337
Conversation
What kind of configuration options if any (like filtering, whitelist, blacklist, enabled) should we provide with this feature? |
I would only add I'm unsure if we should enabled it by default. On the one hand the info can be quite useful, but it can also contain quite a list of defaults which are the same for all processes. |
@joegallo @alexbrasetvik FYI, we're going this direction for Metricbeat. |
I'd say we should have a whitelist and the feature should be disabled by default due to privacy concerns. Secrets are often stored in env, so we have to make it hard to leak them accidentally. |
To be clear, I mean a whitelist on the variable names, so something like |
836d24d
to
bd054f9
Compare
I added This should be updated to the the ExactMatcher from #2433 when it merges.
|
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. @andrewkroh I merged elastic/gosigar#62.
This gets the ProcArgs implementation.
This PR adds the environment variables that were used to start the process to the data reported in the system process metricset. The data is added as a dictionary under the `system.process.env` key. Environment variables must be whitelisted using an array of regular expressions specified using `process.env.whitelist: []` in the module config. This feature implemented for FreeBSD, Linux, and OS X.
bd054f9
to
6e23846
Compare
The PR is now updated with the final gosigar commit hash. |
Document `process.env.whitelist` which is used by the Metricbeat system process metricset to specify what environment variables should be captured. Adds documentation for elastic#3337.
* Document process.env.whitelist config option Document `process.env.whitelist` which is used by the Metricbeat system process metricset to specify what environment variables should be captured. Adds documentation for #3337. * Add reason behind default behavior for process env vars
* Document process.env.whitelist config option Document `process.env.whitelist` which is used by the Metricbeat system process metricset to specify what environment variables should be captured. Adds documentation for elastic#3337. * Add reason behind default behavior for process env vars (cherry picked from commit f9ac9f2)
* Document process.env.whitelist config option Document `process.env.whitelist` which is used by the Metricbeat system process metricset to specify what environment variables should be captured. Adds documentation for #3337. * Add reason behind default behavior for process env vars (cherry picked from commit f9ac9f2)
This PR adds the environment variables that were used to start the process to the data reported in the system process metricset. The data is added as a dictionary under the
system.process.env
key. Environment variables must be whitelisted using an array of regular expressions specified usingprocess.env.whitelist: []
in the module config.This feature implemented for FreeBSD, Linux, and OS X.
Sample config: