open-telemetry / opentelemetry-js-contrib

OpenTelemetry instrumentation for JavaScript modules
https://opentelemetry.io
Apache License 2.0
709 stars 529 forks source link

Add support for Express v5 #2435

Open timfish opened 2 months ago

timfish commented 2 months ago

Express v5 has been released and it's not supported: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/80c2f1af6139e43522a944ab496fed68ef912fb2/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts#L61-L62

I'm looking into the changes required so you can assign this issue to me!

pichlermarc commented 2 months ago

@timfish It's yours, thanks for looking into it :slightly_smiling_face:

pichlermarc commented 2 months ago

cc @JamieDanielson @pkanal (component owners)

timfish commented 2 months ago

I want to retain the v4 tests, duplicate them and test v5 too. To have both versions installed, I was going to use aliases but then realised this does not work because importing express5 does not get instrumented!

    "express": "4.19.2",
    "express5": "npm:express@5.0.0",

I can see for redis, there are two seperate instrumentations for v3 and v4 but it doesn't look this this will be required for express because so far it's looking like not much will need to be changed.

Any tips on what I should do to test both versions? I could add another package.json and node_modules inside the v5 test directory?