Azure / Azure/azure-functions-docker
Unable to import opentelemetry packages with `mcr.microsoft.com/azure-functions/python:4-python3.13`
- Dominant language
- Dockerfile
- Stars
- 280
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
I have a [basic reproduction](https://github.com/[ksstott/azure-functions-python-otel](https://github.com/ksstott/azure-functions-python-otel) of an issue I am having whereby I am unable to import from opentelemetry packages (e.g. `from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter`) when using the `mcr.microsoft.com/azure-functions/python:4-python3.13` image.
Running the docker image in the [basic reproduction](https://github.com/[ksstott/azure-functions-python-otel](https://github.com/ksstott/azure-functions-python-otel) will hang before finally starting but with 0 functions loaded however with no obvious error visible.
Removing the `from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter` line allows the app to run successfully.
Alternatively switching to the `mcr.microsoft.com/azure-functions/python:4-python3.12` image (but keeping the import statement) also allows the app to run successfully.
I've deployed this app to a regular flex-consumption app in Azure using `func azure functionapp publish` and this works successfully which leads me to believe that this is something specific to docker
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked basic reproduction and run it using mcr.microsoft.com/azure-functions/python:4-python3.13, comparing behavior with the python:4-python3.12 image. Focus on the OTLPSpanExporter import and the point where the container hangs with zero functions loaded. Done means the reproduction starts and loads its functions on Python 3.13 with the import present, without regressing the working Python 3.12 or deployed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100