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

Support: Express v5 #4704

Closed
vernak2539 opened this issue Sep 19, 2024 · 6 comments
Closed

Support: Express v5 #4704

vernak2539 opened this issue Sep 19, 2024 · 6 comments

Comments

@vernak2539
Copy link

Hello there! Express v5 was just released. It'd be great if we could get support for this as we're encountering errors when running with dd-trace instrumented.

I've tried to put a bunch of information below, but let me know if more is needed.

I saw this old issue from a while ago, but felt it would be better to submit a new one as v5 is now out!

Extra Information

  • express: v5.0.0
  • dd-trace: v5.22.0 (tried also with 5.12.0 prior to upgrading)

We run our app using this command:

node -r ./.env/development.cjs --import ./src/node-instrumentation.mjs .
  • ./.env/development.cjs - uses dotenv-extended to load environment variables
  • ./src/node-instrumentation.mjs - imports our datadog tracing, more below
  • . runs the main file in the package.json

The ./src/node-instrumentation.mjs looks something like this:

import tracer from 'dd-trace';

const hostname = process.env.STATSD_HOST;

if (hostname) {
  tracer.init({
    hostname: process.env.STATSD_HOST,
    service: appName,
    debug: process.env.DATADOG_DEBUG_ENABLED === 'true',
  });
  tracer.use('express', {
    service: `${appName}/express`,
    hooks: {
        // hook stuff, nothing too interesting other than setting span tags
      },
    },
  });
  tracer.use('http', { service: `${appName}/http-client` });
  tracer.use('dns', { service: `${appName}/dns` });
  tracer.use('net', { service: `${appName}/tcp` });
}

This is the error we get when running the application.

TypeError: Cannot read properties of undefined (reading 'fast_star')
    at isFastStar (/Users/testuser/repo/node_modules/dd-trace/packages/datadog-instrumentations/src/router.js:124:22)
    at Object.test (/Users/testuser/repo/node_modules/dd-trace/packages/datadog-instrumentations/src/router.js:116:17)
    at errorMiddleware (/Users/testuser/repo/node_modules/dd-trace/packages/datadog-instrumentations/src/router.js:39:27)
    at errorMiddleware (/Users/testuser/repo/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:31:21)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:113:17)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:122:5)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleError (/Users/testuser/repo/node_modules/router/lib/layer.js:108:12)
    at trimPrefix (/Users/testuser/repo/node_modules/router/index.js:335:13)
    at /Users/testuser/repo/node_modules/router/index.js:295:9
    at processParams (/Users/testuser/repo/node_modules/router/index.js:575:12)
    at next (/Users/testuser/repo/node_modules/router/index.js:289:5)
    at Layer.handleRequest (/Users/testuser/repo/node_modules/router/lib/layer.js:154:5)
@Vakintoshka
Copy link

Hey everyone,

Are there any updates or plans to include this in the roadmap? Our security audit requires us to move from express@5-beta to the stable express@5 release, but we’re currently facing compatibility issues with dd-trace.

Any guidance or updates would be greatly appreciated!

@rhyschard
Copy link

We are running into the same issue, any updates? Express 5.0.1..

@porfirioribeiro
Copy link

Hey everyone,

I'm wondering about the status of this, I would like to update to express 5, but this issue is blocking me.
Any news on what is needed to do to support it?

@siketyan
Copy link

siketyan commented Jan 7, 2025

Express 5 support seems already landed in #4913 and v5.29.0

@porfirioribeiro
Copy link

Express 5 support seems already landed in #4913 and v5.29.0

Ohh, my bad, i guess i missed it in the middle of the release notes, maybe this issue can be closed?

@wconti27
Copy link
Contributor

wconti27 commented Jan 8, 2025

Hi all,

Express v5 support landed with #4913 and is available in v5.29.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants
@porfirioribeiro @vernak2539 @tlhunter @rhyschard @Vakintoshka @siketyan @wconti27 and others