-
Notifications
You must be signed in to change notification settings - Fork 821
opentelemetry-instrumentation-system-metrics: add OTEL_PYTHON_SYSTEM_METRICS_EXCLUDED_METRICS environment variable #3959
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
base: main
Are you sure you want to change the base?
Conversation
09bb5bf to
263b603
Compare
|
Can confirm that this worked as expected. |
| for pat in os.environ.get( | ||
| OTEL_PYTHON_SYSTEM_METRICS_EXCLUDED_METRICS, "" | ||
| ).split(",") | ||
| if pat |
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.
| if pat | |
| if pat.strip() |
To avoid empty strings if there are spaces in the env var
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.
Updated.
| - ``?`` - Matches any single character | ||
| - ``[seq]`` - Matches any character in the sequence | ||
| - ``[!seq]`` - Matches any character not in the sequence |
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.
For this specific use case I think maybe we can limit the documented glob pattern to the * unless is there an obvious use case I'm missing?
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.
Updated.
Description
Implements #3954 to add support for the
OTEL_PYTHON_SYSTEM_METRICS_EXCLUDED_METRICSenvironment variable in order to selectively exclude certain metrics from being exported.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Several test scenarios have been added to test the new environment variable configuration option.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.