Description
Describe your environment
- Python 3.11
- Otel Python API/SDK 1.20.0
- opentelemetry-instrument 0.41b0
- Flask 3.0.0, released 2 days ago: https://github.com/pallets/flask/releases/tag/3.0.0
- Running on local in docker container
FROM python:3.11
Attempting to do opentelemetry-bootstrap
after installing Flask 3 results in a quiet message: instrumentation for package flask<3.0,>=1.0 is available but version flask==3.0.0 is installed. Skipping.
Attempting to manually install opentelemetry-instrumentation-flask
gives a different message: DependencyConflict: requested: "flask >= 1.0, < 3.0" but found: "flask 3.0.0"
The Flask app successfully loads and Otel API can be used to manually create spans (tracer.start_as_current_span
). But SERVER
spans are not created for requests accepted by the Flask app that should be intercepted by instrumentation. Here is an example 1-span trace exported to console with only the INTERNAL
type span:
172.26.0.1 - - [02/Oct/2023 22:19:02] "GET /test/ HTTP/1.1" 200 -
{
"name": "my_test_trace",
"context": {
"trace_id": "0x3c881a21a3f4f695ebf19c55be7d36c5",
"span_id": "0xd58cce9986a06144",
"trace_state": "[]"
},
"kind": "SpanKind.INTERNAL",
"parent_id": null,
"start_time": "2023-10-02T22:19:02.966587Z",
"end_time": "2023-10-02T22:19:02.966610Z",
"status": {
"status_code": "UNSET"
},
"attributes": {},
"events": [],
"links": [],
"resource": {
"attributes": {
"telemetry.sdk.language": "python",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.20.0",
"service.name": "unknown_service"
},
"schema_url": ""
}
}
Steps to reproduce
I've posted a repo here with two ways to reproduce: https://github.com/tammy-baylis-swi/otel-flask-three
What is the expected behavior?
There should be no errors at bootstrap or manual install/instrument of Flask, and traces should include SERVER
type spans when the Flask app receives a request. I think instrumentation should support Flask 3 at some point.
What is the actual behavior?
There are error messages (see above) and traces do not include SERVER
type spans when the Flask app receives a request.
Additional context
I think it's from this version requirement in opentelemetry-instrumentation-flask. Upgrading to Flask 3 from the previous 2.3.3 might be breaking so some testing is needed.
[project.optional-dependencies]
instruments = [
"flask >= 1.0, < 3.0",
]