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

instrumentation error on Fastify version 4 #2118

Closed
inaiat opened this issue Jun 9, 2022 · 1 comment
Closed

instrumentation error on Fastify version 4 #2118

inaiat opened this issue Jun 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@inaiat
Copy link

inaiat commented Jun 9, 2022

Expected behaviour
simple request must retun http 200 status

Actual behaviour
any request return an error 500 with erro message: '"next is not a function"

Steps to reproduce
add import import './tracer' on entry point of app

tracer.ts:

import tracer from 'dd-trace'
tracer.init({ logInjection: true })
tracer.use('http', {
  blocklist: ['/health'],
})
export default tracer

Environment

  • Operation system: linux - kernel 5.15.41-1-MANJARO
  • Node.js version: v16.15.0
  • Tracer version: 2.9.0
  • Relevant library versions: fastify v4

"dependencies": {
"@fastify/autoload": "^5.0.0",
"@fastify/awilix": "^3.0.0",
"@fastify/sensible": "^5.0.0",
"@fastify/swagger": "^7.2.0",
"@fastify/type-provider-typebox": "^1.0.0",
"@sinclair/typebox": "^0.23.5",
"awilix": "7.0.3",
"dd-trace": "^2.9.0",
"env-schema": "5.0.0",
"fastify": "4.0.0",
"fastify-plugin": "^3.0.1",
"nanoid": "^3.0.0"
}

"type": "TypeError",
      "message": "next is not a function",
      "stack":
          TypeError: next is not a function
              at /inaiat/node_modules/dd-trace/packages/datadog-instrumentations/src/fastify.js:129:41
              at exports.AsyncResource.runInAsyncScope (node:async_hooks:202:9)
              at Object.preParsing (/inaiat/node_modules/dd-trace/packages/datadog-instrumentations/src/fastify.js:129:19)
              at next (/inaiat/node_modules/fastify/lib/route.js:501:16)
              at preParsingHookRunner (/inaiat/node_modules/fastify/lib/route.js:524:3)
              at runPreParsing (/inaiat/node_modules/fastify/lib/route.js:475:5)
              at next (/inaiat/node_modules/fastify/lib/hooks.js:168:7)
              at /inaiat/node_modules/dd-trace/packages/datadog-instrumentations/src/fastify.js:62:29
              at exports.AsyncResource.runInAsyncScope (node:async_hooks:202:9)
              at arguments.<computed> (/inaiat/node_modules/dd-trace/packages/datadog-instrumentations/src/fastify.js:61:38)
@inaiat inaiat added the bug Something isn't working label Jun 9, 2022
@rochdev
Copy link
Member

rochdev commented Jun 10, 2022

This was fixed in #2114 and we're in the process of shipping a new patch release.

@rochdev rochdev closed this as completed Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants