-
Notifications
You must be signed in to change notification settings - Fork 534
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
feat(express): Skip update HTTP's span name and update RpcMetadata's route instead #1557
Conversation
PS: I also encounter issue with The package include a conflict
need to hoist those dependency for the installation to work. |
plugins/node/opentelemetry-instrumentation-express/src/types.ts
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1557 +/- ##
==========================================
- Coverage 96.06% 95.95% -0.11%
==========================================
Files 14 21 +7
Lines 914 1186 +272
Branches 199 255 +56
==========================================
+ Hits 878 1138 +260
- Misses 36 48 +12
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this, it looks great!
I think the only concern I have on this is related to the breaking change for using the spanNameHook to override the HTTP span name. I'm not sure how common it is to use or if we need a deprecation period. We can still override Express span names with the hook, which I would think is the true purpose of this hook anyway but I know folks like to have options to rename auto-generated span names 🤔 .
This will be also a breaking change as @opentelemetry/instrumentation-express's spanNameHook. This config previously support overide HTTP route span's name, which is allow in spec => this might be something we can introduce back to @opentelemetry/instrumentation-http
Due to how |
The So one could actually rename the span as of now. Missing piece for real world is likely that this hook doesn't know the http.route and In general I think the current solution that express instrumenation is not touching the parent span is the way to go. Having the rpc data as a path to transfer data in a define way is fine. If we need span name customization for http spans it's should be offered by http instrumentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need span name customization for http spans it's should be offered by http instrumentation.
Agreed 💯 .
Thank you both for clarification! This looks good to me.
Don't know wy this PR fail unit test, let me investigate a little bit before merge. |
This reverts commit 483c7f1.
https://github.com/open-telemetry/opentelemetry-js-contrib/actions/runs/5504980559/jobs/10031782721 Not sure what is the next step we should do for this PR to be merged? |
Which problem is this PR solving?
Each framework has a different approach to updating Span's name and HTTP_ROUTE attribute. We want to delegate this to instrumentation-http for consistent's name and attribute
This PR fixes the above issue for express
Short description of the changes
spanNameHook
. This config previously support overide HTTP route span's name, which is allow in spec => this might be something we can introduce back to @opentelemetry/instrumentation-httprpcMetadata.route
is set. So there should be no visible change to end-user.server.close()
is not called) when the test is failing => this cause running test withnpm run test -- --scope @opentelemetry/instrumentation-express
seem stuck without any indicator