-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Record response headers on http client spans #9643
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
Comments
We have some code for this already for replay, we may be able to hoist this up somehow! |
I wanted to bump this as we are currently running into a need for this! We have automatic tracing implemented using the JavaScript SDK, and would like to be able to augment our spans with custom attributes based on response headers. Our use case is that we are making changes to our APIs to add an internal caching framework, and are sending metadata around cache hits via response headers. We'd like to be able to segment/analyze span duration in the Sentry UI based on this metadata to monitor pre/post performance changes. This appears to basically be the response version of #15979, which was recently added. As an alternative it seems we could wrap all of our requests in spans to manually instrument post-processing of spans (https://docs.sentry.io/platforms/javascript/tracing/instrumentation/requests-module/), but as far as I can tell this is entirely independent of tracing and would require us to roll our own behavior for things like sampling. |
Thanks for raising your use case. It is indeed a bit tricky to do this yourself because we don't expose the spans for fetch requests in any way. This is still on our backlog and imo it makes definitely sense to implement. |
There are valid use cases where you would want to capture the response headers on an HTTP client span. E.g. when you don't control the backend so you can't instrument it.
Our current implementation doesn't allow for this. We should add functionality to capture HTTP response headers.
The text was updated successfully, but these errors were encountered: