DataDog / dd-trace-js

JavaScript APM Tracer
https://docs.datadoghq.com/tracing/
Other
650 stars 306 forks source link

Hapi 20.3.0 not supported in 2.46.0 #3773

Open SterlingKelley opened 1 year ago

SterlingKelley commented 1 year ago

Expected behaviour @hapi/hapi should be instrumented

Actual behaviour Only @hapi/hapi <=20.2.1 is instrumented

Steps to reproduce

npm install @hapi/hapi@20.3.0
npm install dd-trace@2.46.0
import 'dd-trace/init.js'
import Hapi from '@hapi/hapi'

const server = Hapi.server({ port: 0, host: 'localhost' })
server.route({ method: 'GET', path: '/', handler: (request, h) => 'foo\n' })
await server.start()
process.send({ port: server.info.port })

Environment

  "dependencies": {
    "@hapi/hapi": "20.3.0",
    "dd-trace": "2.46.0"
  },

Support for newer versions of @hapi/hapi was explicitly dropped in this commit likely due to Hapi 21 dropping support for older version of Node. However the latest version of Hapi 20 is not instrumented as a result.

tlhunter commented 11 months ago

Is it possible to upgrade the version of the tracer you're using?

I believe the commit you've linked to from a year ago only affects the end of life v2.x branch, but never landed in the currently maintained v3.x and v4.x branches.

If not, you could probably fork this repo, checkout the v2.x branch, make a commit to revert the 7fbc0c4807e00f6e246bc37437ecc3a54c0b2a19 commit, push it to your fork, then point to that in your package.json file. Here's some more information:

https://docs.npmjs.com/cli/v9/configuring-npm/package-json?v=true#git-urls-as-dependencies