-
Notifications
You must be signed in to change notification settings - Fork 518
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
FastifyDeprecation: Request#context property access is deprecated. Please use "Request#routeConfig" or "Request#routeSchema" instead for accessing Route settings. The "Request#context" will be removed in fastify@5
.
#1275
Comments
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Bump |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
PR is incoming in fastify: fastify/fastify#4470 |
bump :( |
To fix the issue in opentelemetry, you would need to patch opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts Line 263 in 154b30b
There I think you would need to change it to: const handlerName = (((request as any).routeConfig || {})?.name || '').substr(6); |
Or maybe even simpler: const handlerName = (request as any)?.routeConfig?.name?.substr(6) || ''; I did not test it. |
Alas that one won't work as the routeConfig does not expose the handler, so we're waiting for fastify/fastify#4470 |
I closed the remaining issues in the fastify PR and requested review by @Eomm |
Wouldn't this be the most type safe way to fix the warning? const handlerName = `${request.routeOptions.method} ${request.routeOptions.url}`; |
This particular label is for the name of the handler (e.g. the name of the function), so changing it would be a breaking a change |
Change in Fastify landed now (:tada:), so once that's released it's hopefully not too difficult to migrate the instrumentation.
The instrumentation is experimental ( |
It's now available in the latest Fastify release that was released today 🥳 |
Hmm, just a note, I'm getting these deprecation warnings as well from this instrumentation lib
Could be this line? opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts Line 272 in b10224b
edit: I see that the PR linked to this issue is addressing that though, nice! 💯 |
yes |
Is there any PR updating this? |
#1679 |
Thanks, @Travispersson! |
Still getting this error
We are using the latest version of the intrumentation and version 4.24.2 of fastify |
So digging a bit further into it, I think it might when the requests are to not found pages. but then both |
I can confirm that I'm also still getting these errors
|
That's separate from the one in the OP (which hss been fixed, from what I can tell). Might be worth its own issue? Or just somebody sending a PR 🙂 |
I've split it into a separate issue here #1757 |
^ @pichlermarc I think you can close this issue. |
What version of OpenTelemetry are you using?
@opentelemetry/instrumentation-fastify@0.30.1
What version of Node are you using?
v16.14.2
What did you do?
Node auto instrumentation on a Fastify application
What did you expect to see?
No deprecation notices
What did you see instead?
Additional context
Request
.context
is used here:opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts
Line 262 in aff84bb
The text was updated successfully, but these errors were encountered: