opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

opentelemetry-instrument fails to load flask instrumentaiton if werkzeug==3.0.0

Open aleuyX opened this issue 3 years ago • 2 comments

Steps to reproduce Use opentelemetry-instrument command to instrument a flask application (flask<3)

What is the expected behavior? Instrumentation works

What is the actual behavior? Instrumentation does not work, and no error is shown in the console

Additional context I had to use breakpoints to inspect instrumentation loading, found that the instrumentation wants werkzeug<3.0.0 when I have werkzeug==3.0.0

I was following opentelemetry flask instrumentation tutorial which asks for flask<3, the latest version installed by pip is flask==2.3.3 which requires Werkzeug >= 2.3.7, currently pip will install Werkzeug==3.0.0 which leads to this issue.

As the logs of the instrumentation are muted the dependency error is not shown, werkzeug version was pinned here https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980

aleuyX avatar Nov 13 '23 17:11 aleuyX

Yes, confirming this @aleuyX True. I made it work properly only with Flask==2.3.3 and Werkzeug==2.3.7 Hopefully the team will fix the bug so that we can use Flask 3.

nuevoEden avatar Nov 15 '23 10:11 nuevoEden

I had the same issues. It looks like there is a pull request pending to fix this. https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2013

philipcwhite avatar Nov 16 '23 12:11 philipcwhite