opentelemetry-js-contrib icon indicating copy to clipboard operation
opentelemetry-js-contrib copied to clipboard

Add support for Express v5

Open timfish opened this issue 1 year ago • 6 comments

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!

timfish avatar Sep 17 '24 00:09 timfish

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

pichlermarc avatar Sep 17 '24 10:09 pichlermarc

cc @JamieDanielson @pkanal (component owners)

pichlermarc avatar Sep 17 '24 10:09 pichlermarc

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:[email protected]",

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?

timfish avatar Sep 17 '24 15:09 timfish

Hi just curious about the future of this. Movement on the PR looks stalled, but it seems like Express team is looking to emit events that would allow for a simpler implementation. Are you waiting for those events or shipping first as-is? Is there any blocker or is it just one of those "need to find the time" things?

Cheers!

hitsthings avatar Jan 30 '25 23:01 hitsthings

Movement on the PR looks stalled, but it seems like Express team is looking to emit events that would allow for a simpler implementation. Are you waiting for those events or shipping first as-is? Is there any blocker or is it just one of those "need to find the time" things?

Yep, that's about it. The plan is to use Node diagnostics_channels to send events from the router package that can be consumed by Open Telemetry. There's an old open PR to do this but it's years old and wasn't specifically created with Otel in mind. I'm looking into getting a new PR working but I don't have any time scale yet.

timfish avatar Jan 31 '25 00:01 timfish

Awesome, thanks for that update! Much appreciated!

hitsthings avatar Jan 31 '25 02:01 hitsthings

Wondering any update on the new PR ?? We are using Express 5 and wanted to implement OpenTelemetry.

CreativeBrainInc avatar Apr 23 '25 15:04 CreativeBrainInc