-
Notifications
You must be signed in to change notification settings - Fork 13
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
Can't get this package to work at all, am I missing something? #684
Comments
Hi @abecks , it doesn't look you're missing anything, that seems strange 🤔 . I''l try to take a look at it and get back to you |
@abecks Can you share something more about your environment? I can't riproduce your issue . |
@dnlup Sorry to dump that issue without further information. Been trying to strip away parts of my app to try to figure this one out. The weird thing is that the ultimate calls to Sentry.captureException return a sentryEventId.. but that ID doesn't exist in my Sentry account. I'll keep working on it today/this week and let you know if I can figure out whats going on. Appreciate the help. |
It looks like somehow a scope is being created that does not have a Sentry client attached, and Sentry internally short circuits without an error. Edit: It also looks to be related to the tracing request handler. When I disable tracing, errors are showing up in Sentry! |
If tracing is enabled, the tracingRequestHook runs before the errorWrapperRequestHandler. This appears to cause strange behavior, as I've found two possible solutions.
lib/request.js ends with this block:
Is there a reason the errorWrapperRequestHook is registered after the tracingRequestHook? Also, in Sentry's official Koa guide, they register the hook with Edit with my versions: It looks like hub.configureScope is now deprecated, but updating it to the new syntax did not fix the problem. |
Thank you @abecks for the detailed investigation, I'll try to reproduce it and migrate deprecated SDK apis and see if that changes this behavior.
It is usually the last handler in the request response lifecycle, the fact that the tracing handler is registered before should not matter. It's really strange that you have a scope without a client associated 🤔 A couple of last questions, are you installing the SDK separately or are you using the one installed by the plugin? Also, does this happen also with the version 7 of the plugin? Thank you |
I am sorry @abecks but I really can't reproduce this issue, I made a repo where we can make tests: https://github.com/dnlup/fastify-sentry-tests Feel free to use it and modify it to match your environment, if you have the time |
I'm having a similar issue with NestJs + Fastify. I figured that it works properly if I register a route in the main file like this: app.getHttpAdapter().get("test-route", (req, res) => {
throw new Error("Sentry test");
}); But it doesn't work if I throw an error from a controller or a GraphQL resolver, I'm not receiving the errors in Sentry. I'm still debugging but I couldn't find where the problem is so far. |
This looks like a great wrapper for Sentry + Fastify. I'd love to use it in my project.
I don't know if I'm missing an important step in the instructions or something, but I cannot get this to work at all:
I have the following issues:
captureException
inbase.js
is firing, but nothing is showing up in Sentry.fastify.Sentry.captureMessage()
doesn't work eithertracesSampleRate: 1.0
does not work becauseif (hasTracingEnabled()) {
inrequest.js
evaluates to false.I've ensured my SENTRY_DSN is correct, as it works when I use the Sentry Node SDK, and double checked your examples and I don't think I'm missing anything.
Any ideas would be appreciated!
The text was updated successfully, but these errors were encountered: