Skip to content
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

AppSignal logging a lot of fastify deprecation logs #961

Closed
Fernandomr88 opened this issue Nov 17, 2023 · 12 comments
Closed

AppSignal logging a lot of fastify deprecation logs #961

Fernandomr88 opened this issue Nov 17, 2023 · 12 comments

Comments

@Fernandomr88
Copy link

Fernandomr88 commented Nov 17, 2023

So, this is my console since I have started to use AppSignal, 2 months ago.

I'm using the "@appsignal/nodejs": "^3.0.24" version, and NestJS.
It logs this once every minute or more:

[FSTDEP017] FastifyDeprecation: You are accessing the deprecated "request.routerPath" property. Use "request.routeOptions.url" instead. Property "req.routerPath" will be removed in fastify@5.

image

Dependencies:

    "@appsignal/nodejs": "^3.0.24",
    "@fastify/multipart": "^8.0.0",
    "@fastify/static": "^6.11.2",
    "@nestjs/bull": "^10.0.1",
    "@nestjs/common": "^10.2.6",
    "@nestjs/core": "^10.2.6",
    "@nestjs/platform-fastify": "^10.2.6",
@Fernandomr88
Copy link
Author

I even created an issue for an update on dependencies but that didnt solve that issue.

#947

@unflxw
Copy link
Contributor

unflxw commented Nov 17, 2023

Which fastify version are you using @Fernandomr88? (the dependencies shown include @fastify/static and @fastify/multipart, but not Fastify itself)

A workaround would be to downgrade to the Fastify version before these warnings were added.

@Fernandomr88
Copy link
Author

Fernandomr88 commented Nov 17, 2023

Which fastify version are you using @Fernandomr88? (the dependencies shown include @fastify/static and @fastify/multipart, but not Fastify itself)

A workaround would be to downgrade to the Fastify version before these warnings were added.

4.23.2

I don't see that as a workaround since I'm not depending directly on fastify but on packages (such as @nestjs/platform-fastify) that depend on fastify.

If I disable AppSignal the errors stop, so the issue is coming from AppSignal itself and not third party packages.

@unflxw
Copy link
Contributor

unflxw commented Nov 17, 2023

I don't see that as a workaround since I'm not depending directly on fastify but on packages (such as @nestjs/platform-fastify) that depend on fastify.

I see! May I suggest an override? With overrides, you can force your dependencies to use specific versions of their dependencies. On your package.json, add the following:

{
  // ...
  "overrides": {
    "fastify": "4.15.0"
  }
}

The warning first appeared in version 4.16.0 (see commit) so I would suggest pinning it to version 4.15.0 to get rid of the warnings.

If I disable AppSignal the errors stop, so the issue is coming from AppSignal itself and not third party packages.

Correct! Well, specifically, from the @opentelemetry/instrumentation-fastify dependency, which we bring in. But the warning is emitted by fastify through something that our instrumentation does.

@Fernandomr88
Copy link
Author

I don't see that as a workaround since I'm not depending directly on fastify but on packages (such as @nestjs/platform-fastify) that depend on fastify.

I see! May I suggest an override? With overrides, you can force your dependencies to use specific versions of their dependencies. On your package.json, add the following:

{
  // ...
  "overrides": {
    "fastify": "4.15.0"
  }
}

The warning first appeared in version 4.16.0 (see commit) so I would suggest pinning it to version 4.15.0 to get rid of the warnings.

If I disable AppSignal the errors stop, so the issue is coming from AppSignal itself and not third party packages.

Correct! Well, specifically, from the @opentelemetry/instrumentation-fastify dependency, which we bring in. But the warning is emitted by fastify through something that our instrumentation does.

So the correct solution to this is to talk to @opentelemetry guys and see what can be done, right? I mean, depending on an older version of fastify (sept 2022) may introduce bugs and/or vulnerabilities to my server that I don't desire.

@unflxw
Copy link
Contributor

unflxw commented Nov 17, 2023

@Fernandomr88 That's part of it, yes. There is this GitHub issue upstream where they're looking into solving this issue and suggesting other workarounds.

@unflxw
Copy link
Contributor

unflxw commented Nov 17, 2023

Also, note that you can use the NODE_NO_WARNINGS environment variable to silence the warnings: https://github.com/fastify/process-warning#suppressing-warnings

@Fernandomr88
Copy link
Author

@Fernandomr88 That's part of it, yes. There is this GitHub issue upstream where they're looking into solving this issue and suggesting other workarounds.

I'll try to contribute there, in the meanwhile I'll use that env to suppress the warning.

Also, in my opinion this issue should remain open until this problem is solved. AppSignal is the factor to produce those logs and this issue should be in your radar until solved by open-telemetry

@Fernandomr88
Copy link
Author

@unflxw seems like the fix is being merged.

open-telemetry/opentelemetry-js-contrib#1757 (comment)

@shairyar
Copy link
Member

shairyar commented Dec 7, 2023

@Fernandomr88
Copy link
Author

open-telemetry/opentelemetry-js-contrib#1829

it has been merged already. Any ETA to update this dependency?

@unflxw
Copy link
Contributor

unflxw commented Dec 7, 2023

Hi @Fernandomr88! The update is still in the allowed version range, so running npm update @opentelemetry/instrumentation-fastify should do the trick.

@unflxw unflxw closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants