-
Notifications
You must be signed in to change notification settings - Fork 2
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
Request body and path parameters in Flask/FastAPI/Starlette #80
Comments
✔️ All good! |
@unflxw you mentioned something in a DM about reading the params from a request not being as easy as asking |
Ah, yes, thanks for bringing it up @tombruijn! Here's some words. First, some context: the Flask instrumentation is a tiny wrapper over the WSGI instrumentation, with the main difference being that it wraps the WSGI app inside a Flask app automatically, and adds Flask routing information. Similarly, the FastAPI and Starlette instrumentations are tiny wrappers over the ASGI instrumentation. All of these frameworks (Flask, FastAPI, Starlette) offer a convenient way to read the request body as a JSON ( But! Because the instrumentations are tiny wrappers over the WSGI and ASGI instrumentations, what we get in the configurable For a WSGI environ, there is a For an ASGI scope... I have no idea how we'd do it. The body isn't even in the ASGI scope -- it's obtained by awaiting this separate This might require modifying the ASGI instrumentation so that this channel is passed along -- confusingly, there is a Instead, we might want to modify the FastAPI and Starlette instrumentations, so that we can define a hook that receives a Starlette request as an argument, instead of an ASGI scope. Then we can call the convenience methods there. |
Requested by customer. Intercom link: https://app.intercom.com/a/inbox/yzor8gyw/inbox/shared/unassigned/conversation/16410700259499?view=List |
Just writing a note that we're seeing customers implement this on their own endpoints by calling |
Currently these integrations show no params. It would be nice to try and get params showing, ideally both from the request body JSON and from the path parameters.
The text was updated successfully, but these errors were encountered: