-
Notifications
You must be signed in to change notification settings - Fork 544
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(instrumentation-express): propagate context and measure full handler spans #2638
base: main
Are you sure you want to change the base?
feat(instrumentation-express): propagate context and measure full handler spans #2638
Conversation
cc @pichlermarc fixes discussed wednesday |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2638 +/- ##
=======================================
Coverage 90.78% 90.79%
=======================================
Files 169 169
Lines 8056 8062 +6
Branches 1643 1645 +2
=======================================
+ Hits 7314 7320 +6
Misses 742 742
|
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.
this looks good, thank you for working on this. 🙌
cc @JamieDanielson and @pkanal (component owners) for comments :)
Apologies for the outsider coming in on this PR, but reporting that I've manually applied this PR into a local working copy to validate it works with my sample apps and it worked! In fact, it already helped me catch a case or two where I was missing an |
Which problem is this PR solving?
Currently the Express instrumentation does not propagate context and does not properly instrument request handlers.
Short description of the changes
Context is propagated for middleware and request handler spans, while their
next
callback is reset to the parent context to avoid extreme nesting as suggested in #2022. Request handler spans are also no longer ended prematurely.Router spans are kept as-is since they are broken and propagating context for them would make things even more confusing than they already are.
Example traces
Before
After
Related issues