-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Use diagnostics channel for Fastify v5 error handling #16715
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
base: develop
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
53d3aac
to
134bf84
Compare
} | ||
}); | ||
|
||
if (fastify.version?.startsWith('5.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break for > v5!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional, just in case Fastify v6 uses a different diagnostics channel hook for errors when published. It won't break if 6.x
is used here, in the worst scenario, the error will be captured twice, and deduped eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we check if our tracing:fastify.request.handler:error
diagnostics channel listener was registered, that feels like a more robust check.
I guess this is hard because others can also register on tracing:fastify.request.handler:error
. Perhaps we can do this by setting a field on the integration? Then you can grab the current client fastify integration instance and check.
Resolves: #15936