Calling flask.copy_current_request_context
results in error logged from OTEL context.detach/Flask instrumentation
#868
Labels
Steps to reproduce
Install the latest requirements in a
venv
:Use the following code to create a running Flask application.
curl http://localhost:5000/
and not the logged error ofFailed to detach context
from here.What is the expected behavior?
No
Failed to detach context
error message logged. I'd expect the async work span(s) to be also have theparent_id
set to a span in the originating HTTP request thread of execution (though perhaps my expectation is off on this point).What is the actual behavior?
The
Context
logs the following errorFailed to detach context
from thedo_some_work
thread of execution when attempting to clean up the context created in the HTTP request handlerindex
Additional context
Note I originally reproduced this issue in Flask 1.x. It appears the Flask code hasn't changed much in this area so I'd expect any solution would be compatible with Flask 1.x as well.
The text was updated successfully, but these errors were encountered: