-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Configuring plugin before routes breaks all my tests #12
Comments
Hi! Can you provide an Minimum Reproducible Example to support you better? |
Hi @metcoder95 I think I confused something before. It looks to me like when registering the Otel plugin right after the server initialization and before any hook/route definition some of the hooks are getting executed when they should be. I've created this small repo as an example. If you ran the tests you should get a 404 error thrown from this |
I can see what is happening; I've been playing with it a bit and it seems the plugin mixes the child with the parent context while handling the decoration patches. Already working on a fix |
Note sure if it is related, but here: https://github.com/Eomm/fastify-overview/blob/main/index.js I tracked routes and plugins if it can help with the solution 👍🏼 |
Thanks a lot, applied a fix; will open a PR soon 👍 |
Thanks @metcoder95 |
Prerequisites
Issue
Hi
I am trying to integrate Otel to my Fastify server. I tried following the requirement from the documentation and set up the plugin right after creating the Fastify instance.
However, doing so broke all my routes (all tests are failing) many of them return 404.
If I configure the plugin after registering routes it seems to work somewhat okay (endpoint work, I see traces but I don't all my hooks being traced).
Does anyone have any idea why this is happening?
If there is more info I can provide to help diagnose this issue please let me know 🙂
The text was updated successfully, but these errors were encountered: