-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
@sentry/node async contexts play poorly with http response events #13452
Comments
Hi @theo-m, thanks for writing in and thanks for providing a reproduction! I gave it a try and what I can see is that the error that's sent to Sentry is the "not happy" error you're throwing in your test route. This is what you'd expect, right? Likewise, this is the error that I get returned on the client side. Now, pino logs the "failed with status code 500" error, but it does so regardless of if I remove all Sentry imports or leave them in place. Can you clarify what's the expected behaviour/what exactly is going wrong? |
Yes indeed! My problem is what's logged by pino, which is confusing when reading server logs - and the heart of the problem.
You're right! I've tried a couple of ablations and permutations and got things mixed up, I'm observing the issue when removing Sentry still - my bad for opening a ticket on a Friday haha Will close, sorry for the waste of time and thanks for looking at this 🙏 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.26.0
Framework Version
No response
Link to Sentry event
https://mra-30.sentry.io/issues/5747145444
Reproduction Example/SDK Setup
Here is reproduction repository: https://github.com/theo-m/repro-sentry-logging
It seems like sentry's async footwork plays poorly with pino-http. I've opened the issue here because I don't think pino-http is at fault, it's just using node's response events.
Steps to Reproduce
You'll observe that express does send the responses appropriately with the right errors - but, what's logged by Pino is entirely different.
Expected Result
see repo https://github.com/theo-m/repro-sentry-logging
Actual Result
see repo https://github.com/theo-m/repro-sentry-logging
The text was updated successfully, but these errors were encountered: