You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using Connexion 3.0 and running my service as a Flask app. Prior to migrating to Connexion, I had my Flask app instrumented via OpenTelemetry Auto-Instrumentation.
While OpenTelemetry Auto-Instrumentation works when running a Connexion app using Flask for any HTTP route / response that the Flask application fully handles, it breaks when relying on any Connexion middleware -- for instance exception handlers.
The impact is that the HTTP metrics show completed requests for HTTP responses handled fully by Flask, but for any response that also uses the Connexion middleware (in this case exceptions handled) the request is shown as still in progress even when it has returned a response to the client. 1
But it would be nice to not have to use this anti-pattern and instead be able to rely on Connexions middleware for error handling.
I believe the fix here is to create an instrumentation library for Connexions similar to Flask. Is this something that has been looked into before or discussed? Thanks!
Hello, I am using Connexion 3.0 and running my service as a Flask app. Prior to migrating to Connexion, I had my Flask app instrumented via OpenTelemetry Auto-Instrumentation.
While OpenTelemetry Auto-Instrumentation works when running a Connexion app using Flask for any HTTP route / response that the Flask application fully handles, it breaks when relying on any Connexion middleware -- for instance exception handlers.
The impact is that the HTTP metrics show completed requests for HTTP responses handled fully by Flask, but for any response that also uses the Connexion middleware (in this case exceptions handled) the request is shown as still in progress even when it has returned a response to the client. 1
I was able to resolve this metrics reporting issue by handling exceptions within Flask rather than within Connexions as shown in the docs:
But it would be nice to not have to use this anti-pattern and instead be able to rely on Connexions middleware for error handling.
I believe the fix here is to create an instrumentation library for Connexions similar to Flask. Is this something that has been looked into before or discussed? Thanks!
Footnotes
Here is an example output of metrics where you can see that there is still a value of 1 for
http.server.active_requests
even after that active request has completed. In this case the active request was an error handled byconnexions
instead of flask which results in the request never showing as completed in our metrics: https://gist.github.com/PatrickDale/2a9475571895899fc5dd6393f830d8db#file-example-connexion-flask-otel-metrics-json-L24-L39. ↩The text was updated successfully, but these errors were encountered: