Open
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:
There used to be logic there for skipping setup on uninstalled libraries, but it was removed in #40463
Metadata
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Monitor, Monitor Ingestion, Monitor QueryOpenTelemetry instrumentation (not Monitor-specific)Workflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that