-
Notifications
You must be signed in to change notification settings - Fork 86
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
Body not present on instrumentation info.response object #76
Comments
Hi! I've got the same issue here! |
same issue!!
I want to create a new metric but the info.resonse object is a StreamResponse . how can i convert it to dict? |
Same issue. |
Same issue. Body seems to be empty when I print it |
Hey! I took a look in the prometheus middleware where it constructs the Info object. The middleware only grabs the headers and status code and constructs an empty bodied response object. ...
response = Response(headers=Headers(raw=headers), status_code=status_code) # type: ignore
info = metrics.Info(
request=request,
response=response,
method=request.method,
modified_handler=handler,
modified_status=status,
modified_duration=duration,
)
... I dont know why the authors did not include the response body as I know the the FastApi docs middleware docs uses Starlettes |
Hi I linked a PR trying to solve this issue. We are interested in getting this through. Can someone review please? |
Introduction of body data in this way kills performance for large FileResponse responses. |
There is a bug with this implementation. See issue #236. It only works if response data is being streamed. |
FYI: There is a new release with a breaking change regarding this feature. https://github.com/trallnag/prometheus-fastapi-instrumentator/releases/tag/v6.0.0 |
Hi!
When calling the instrumentation function inside my custom metric, the response attribute of the info parameter does not have body.
AttributeError: 'StreamingResponse' object has no attribute 'body'
Is there a way to circumvent this issue or maybe I'm doing sth wrong!
Thank you all in advance!
The text was updated successfully, but these errors were encountered: