-
Notifications
You must be signed in to change notification settings - Fork 822
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
OS: Ubuntu
Python version: 3.13.2
Installed dependencies via uv.
[project]
name = "fastapi-template"
version = "0.1.0"
description = "Template for FastAPI project"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"fastapi[standard]>=0.115.12",
"opentelemetry-distro>=0.53b0",
"opentelemetry-exporter-otlp>=1.32.0",
]
What happened?
When running python application with opentelemetry-instrument command, it spits out error with ModuleNotFoundError: No module named 'tortoise'. Seems to be related to library instrumentation stemmed from pydantic (from fastapi).
Steps to Reproduce
uv add "fastapi[standard]" opentelemetry-distro opentelemetry-exporter-otlp
uv run opentelemetry-bootstrap -a requirements | uv pip install --requirement -
uv run opentelemetry-instrument uvicorn app.main:app --host 0.0.0.0 --port 8080
Expected Result
No error
Actual Result
Importing of tortoiseorm failed, skipping it
Traceback (most recent call last):
File "/home/gambitran/projects/fastapi-template/.venv/lib/python3.13/site-packages/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 74, in _load_instrumentors
distro.load_instrumentor(
~~~~~~~~~~~~~~~~~~~~~~~~^
entry_point, raise_exception_on_conflict=True
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/gambitran/projects/fastapi-template/.venv/lib/python3.13/site-packages/opentelemetry/instrumentation/distro.py", line 61, in load_instrumentor
instrumentor: BaseInstrumentor = entry_point.load()
~~~~~~~~~~~~~~~~^^
File "/home/gambitran/projects/fastapi-template/.venv/lib/python3.13/site-packages/importlib_metadata/__init__.py", line 189, in load
module = import_module(match.group('module'))
File "/home/gambitran/.local/share/uv/python/cpython-3.13.2-linux-x86_64-gnu/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/home/gambitran/projects/fastapi-template/.venv/lib/python3.13/site-packages/opentelemetry/instrumentation/tortoiseorm/__init__.py", line 77, in <module>
import tortoise.contrib.pydantic.base
ModuleNotFoundError: No module named 'tortoise'
Additional context
Error not present with opentelemetry-distro==0.52.b1 / opentelemetry-exporter-otlp==1.31.1
Would you like to implement a fix?
None
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working