-
Notifications
You must be signed in to change notification settings - Fork 76
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
Support OTEL_PYTHON_DISABLED_INSTRUMENTATIONS #294
Support OTEL_PYTHON_DISABLED_INSTRUMENTATIONS #294
Conversation
@@ -10,6 +10,8 @@ | |||
([#291](https://github.com/microsoft/ApplicationInsights-Python/pull/291)) | |||
- Fixing formatting issues for azure sdk | |||
([#292](https://github.com/microsoft/ApplicationInsights-Python/pull/292)) | |||
- Support OTEL_PYTHON_DISABLED_INSTRUMENTATIONS | |||
([#XXX](https://github.com/microsoft/ApplicationInsights-Python/pull/XXX)) |
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.
([#XXX](https://github.com/microsoft/ApplicationInsights-Python/pull/XXX)) | |
([#294](https://github.com/microsoft/ApplicationInsights-Python/pull/294)) |
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.
# use pkg_resources for now until https://github.com/open-telemetry/opentelemetry-python/pull/3168 is merged | ||
for entry_point in iter_entry_points( | ||
"azure_monitor_opentelemetry_instrumentor" | ||
): | ||
lib_name = entry_point.name | ||
if lib_name not in _SUPPORTED_INSTRUMENTED_LIBRARIES_DEPENDENCIES_MAP: | ||
continue | ||
if entry_point.name in disabled_instrumentations: | ||
_logger.debug( |
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.
Probably should use _logger.info
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.
Using debug because it matches the current use in sitecustomize.
@@ -81,6 +86,19 @@ def _default_disable_tracing(configurations): | |||
configurations[DISABLE_TRACING_ARG] = default | |||
|
|||
|
|||
def _default_disabled_instrumentations(configurations): | |||
disabled_instrumentation = environ.get( | |||
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, [] |
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.
Should we add an entry to the README for this 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.
Updated readme
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.
Left a couple of comments.
Using OTEL_PYTHON_DISABLED_INSTRUMENTATIONS functionality from auto instrumentation flow