Skip to content
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

RequestFetcher doesn't return request #818

Open
jkatruska opened this issue Mar 10, 2024 · 3 comments
Open

RequestFetcher doesn't return request #818

jkatruska opened this issue Mar 10, 2024 · 3 comments
Assignees

Comments

@jkatruska
Copy link

How do you use Sentry?

Self-hosted / on-premises

SDK version

4.8.0

Steps to reproduce

Make any request with body and you won't see body or method in sentry.

The problem is in RequestFetcher which relies on getting request from RequestStack. The problem here is that the RequestIntegration which uses RequestFetcher to get request runs on kernel.terminate. By this time, the RequestStack is empty because the handle method of the HttpKernel pops that request from the stack and terminate is called after handle.

Expected result

Data from request will be logged in sentry

Actual result

No data from request are logged

@cleptric
Copy link
Member

cleptric commented Jul 2, 2024

I started looking into this, we might need to cache the request somewhere early in the live cycle. We do the same in our Laravel SDK, so I think this should work in Symfony as well.

@Jean85
Copy link
Collaborator

Jean85 commented Jul 2, 2024

Why caching? Wouldn't be enough to trigger that earlier, i.e. on kernel.request? Or even better, on-demand? We may need to investigate side-effects...

@cleptric
Copy link
Member

cleptric commented Jul 2, 2024

Because we need the data when an error happens (the easy part) and on transaction finish, which happens on kernel.terminate. Hence we store the request early, and have it laying around for the duration of the entire request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants