Skip to content

With azure-monitor-opentelemetry 1.6.7 ,we see Import error as No modules found for fastapi,flask,django . #40573

Open
@Leenasaw

Description

@Leenasaw

We have installed below libraires after cluster restart in our data bricks workspace.

With azure-monitor-opentelemetry 1.6.7 ,

opentelemetry-api 1.32.1

opentelemetry-instrumentation 0.53b1

opentelemetry-instrumentation-asgi 0.53b1

opentelemetry-instrumentation-dbapi 0.53b1

opentelemetry-instrumentation-django 0.53b1

opentelemetry-instrumentation-fastapi 0.53b1

opentelemetry-instrumentation-flask 0.53b1

opentelemetry-instrumentation-psycopg2 0.53b1

opentelemetry-instrumentation-requests 0.53b1

opentelemetry-instrumentation-urllib 0.53b1

opentelemetry-instrumentation-urllib3 0.53b1

opentelemetry-instrumentation-wsgi 0.53b1-


We have been getting below warning in Databricks code as

WARNING:opentelemetry.trace:Overriding of current TracerProvider is not allowed

WARNING:opentelemetry._logs._internal:Overriding of current LoggerProvider is not allowed

WARNING:opentelemetry.metrics._internal:Overriding of current MeterProvider is not allowed

WARNING:azure.monitor.opentelemetry._configure:Exception occurred when instrumenting: fastapi.

Traceback (most recent call last):

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/azure/monitor/opentelemetry/_configure.py", line 222, in _setup_instrumentations

instrumentor: BaseInstrumentor = entry_point.load()

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/importlib_metadata/init.py", line 189, in load

module = import_module(match.group('module'))

File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1050, in _gcd_import

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "", line 883, in exec_module

File "", line 241, in _call_with_frames_removed

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/opentelemetry/instrumentation/fastapi/init.py", line 188, in

import fastapi

ModuleNotFoundError: No module named 'fastapi'

WARNING:azure.monitor.opentelemetry._configure:Exception occurred when instrumenting: flask.

Traceback (most recent call last):

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/azure/monitor/opentelemetry/_configure.py", line 222, in _setup_instrumentations

instrumentor: BaseInstrumentor = entry_point.load()

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/importlib_metadata/init.py", line 189, in load

module = import_module(match.group('module'))

File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1050, in _gcd_import

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "", line 883, in exec_module

File "", line 241, in _call_with_frames_removed

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/opentelemetry/instrumentation/flask/init.py", line 254, in

import flask

ModuleNotFoundError: No module named 'flask'

WARNING:opentelemetry.instrumentation.instrumentor:Attempting to instrument while already instrumented

WARNING:opentelemetry.instrumentation.instrumentor:Attempting to instrument while already instrumented

WARNING:opentelemetry.instrumentation.instrumentor:Attempting to instrument while already instrumented

WARNING:opentelemetry.instrumentation.instrumentor:Attempting to instrument while already instrumented

WARNING:azure.monitor.opentelemetry._configure:Exception occurred when instrumenting: django.

Traceback (most recent call last):

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/azure/monitor/opentelemetry/_configure.py", line 222, in _setup_instrumentations

instrumentor: BaseInstrumentor = entry_point.load()

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/importlib_metadata/init.py", line 189, in load

module = import_module(match.group('module'))

File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1050, in _gcd_import

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "", line 883, in exec_module

File "", line 241, in _call_with_frames_removed

File "/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/opentelemetry/instrumentation/django/init.py", line 244, in

from django import VERSION as django_version

ModuleNotFoundError: No module named 'django'


Please provide us right version to be there With azure-monitor-opentelemetry 1.6.7 and subliabrires .

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.MonitorMonitor, Monitor Ingestion, Monitor QueryService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions