-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Closed
Copy link
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.MonitorMonitor, Monitor Ingestion, Monitor QueryMonitor, Monitor Ingestion, Monitor QueryOpenTelemetryOpenTelemetry instrumentation (not Monitor-specific)OpenTelemetry instrumentation (not Monitor-specific)Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.Workflow: The Azure SDK team believes it to be addressed and ready to close.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
- Package Name: azure-monitor-opentelemetry
- Package Version: 1.6.7
- Operating System:
- Python Version: 3.12
Describe the bug
configure_azure_monitor
attempts to setup instrumentations for libraries that are not installed
To Reproduce
Steps to reproduce the behavior:
- Install
azure-monitor-opentelemetry
without unnecessary dependencies (e.g. withoutdjango
). - Run
configure_azure_monitor
Observe logs like:
Exception occurred when instrumenting: django.
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/azure/monitor/opentelemetry/_configure.py", line 222, in _setup_instrumentations
instrumentor: BaseInstrumentor = entry_point.load()
^^^^^^^^^^^^^^^^^^
Expected behavior
No tracebacks displayed for attempts to setup instrumentation for uninstalled libraries.
Additional context
The problem seems to be in this function:
Lines 210 to 214 in ce204aa
def _setup_instrumentations(configurations: Dict[str, ConfigurationValue]): | |
# entry_point_finder = _EntryPointDistFinder() | |
# use pkg_resources for now until https://github.com/open-telemetry/opentelemetry-python/pull/3168 is merged | |
for entry_point in entry_points(group="opentelemetry_instrumentor"): | |
lib_name = entry_point.name |
There used to be logic there for skipping setup on uninstalled libraries, but it was removed in #40463
cwjoalder
Metadata
Metadata
Assignees
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.MonitorMonitor, Monitor Ingestion, Monitor QueryMonitor, Monitor Ingestion, Monitor QueryOpenTelemetryOpenTelemetry instrumentation (not Monitor-specific)OpenTelemetry instrumentation (not Monitor-specific)Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.Workflow: The Azure SDK team believes it to be addressed and ready to close.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that