-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flask Auto Instrumentation dissapears on debug=True app reload #546
Comments
Is this a duplicate of #477? |
Thanks for pointing me to that, it was helpful because I found out that I also see that the docs were updated in open-telemetry/opentelemetry-python#1795 But I think we could still benefit from either:
It's an easy caveat to miss, and since flask is the first thing you tell auto instrumentation to run (i.e. in |
This issue was marked stale due to lack of activity. It will be closed in 30 days. |
An off top question to everyone. I'm wondering why the |
Describe your environment
python 3.9
flask~=1.0
opentelemetry-api==1.3.0
opentelemetry-sdk==1.3.0
opentelemetry-instrumentation==0.22b0
opentelemetry-instrumentation-flask==0.22b0
Steps to reproduce
I created a very simple flask app
my_app.py
with either debug=False or debug=True:I then use auto-instrumentation to instrument the app with the
ConsoleExporter
:opentelemetry-instrument --trace-exporter console_span python3 my_app.py
What is the expected behavior?
If I use debug=False everything works fine.
Console output:
Browser response is OK:
What is the actual behavior?
If I use debug=True it does not work
No console output:
No trace id that can be returned in the response:
Additional context
I used print statements to confirm that auto instrumentation does run and replace the right methods before the app starts. But when the
Restarting with stat
message appears it seems like the instrumentation is lost.The fix might require investigating how auto reloader works and instrumenting some hidden "clean slate app" that the auto reloader replaces the currently running app with to restart the instrumentation.
The text was updated successfully, but these errors were encountered: