open-telemetry / opentelemetry-js-contrib

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

Setting HTTP_ROUTE inconsistent accross HTTP server frameworks #1381

Open Flarna opened 1 year ago

Flarna commented 1 year ago

HTTP_ROUTE propagation from HTTP server frameworks to HTTP span is inconsistent:

I think all frameworks should avoid modifications of the HTTP span directly instead return the route info via rpcData and leave it up to the HTTP instrumentation to build the final span name and set the HTTP_ROUTE attribute.

Setting HTTP_ROUTE directly breaks for example the assumption done in this PR.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

chigia001 commented 1 year ago

Hey @Flarna, not sure if I can pick this task?

When working on this, should we split it into multiple PR for each framework?

Flarna commented 1 year ago

Sure, feel free to start. I haven't found time to start.

I would start a PR for one framework and once the way how to do it is agree do the remaining ones.

chigia001 commented 11 months ago

Current status:

JamieDanielson commented 11 months ago

We've merged in the change for Express but it looks like there were some unexpected issues that came up. Let's double check these other PRs for Restify, Fastify, Hapi, and Koa to see if we can update those before they are merged in if they have the same problem.

chigia001 commented 11 months ago

@JamieDanielson Yes, I double check and koa seem to have the same issue

I just push a fix for that.