-
Notifications
You must be signed in to change notification settings - Fork 539
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): record exceptions #1657
feat(express): record exceptions #1657
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1657 +/- ##
==========================================
+ Coverage 91.48% 91.49% +0.01%
==========================================
Files 144 144
Lines 7374 7388 +14
Branches 1471 1474 +3
==========================================
+ Hits 6746 6760 +14
Misses 628 628
|
plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
@JamieDanielson Possible to get a review on this ? |
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 the contribution @raphael-theriault-swi !
As you mention, these are definitely two different things and it might be best to try to separate them, but I'll talk through my initial thoughts here first. I tried these changes out using the express example app in this repo (looks like that example needs some updating, will try to get that on the list soon).
The exception is helpful for the error scenario. I'm thinking that is going to be useful and relatively non-controversial to get that in.
I'm a bit concerned about the change in the nesting of the Express spans - it might be exactly what is desired by most users but it might also be jarring to have such a big change to current behavior. I'm not totally sure and will try to solicit some feedback - as I also know some folks filter out middleware spans too.
For visuals, here is the express example with an exception thrown as shown in Zipkin - which clearly shows the exception and the nesting of the spans are somewhat minimal because the trace got cut off:
Here is the happy path in Zipkin with a larger trace, which shows all the nested spans. I guess that's a question to get answered - is this better for most folks? I think the timelines may show better, but the name cascade and nesting may be a little intense.
Love the showing of exceptions on middleware. I do not like the nesting, that's a conceptual change that doesn't fit. It will surprise everyone. Agree with Jamie: if this is broken out, then we could discuss the nesting (thorny) separately from the exceptions (obviously better). |
I also want to +1 the showing exceptions in middleware, that's a great addition and I would love to see it as a separate PR 🙂 For the nesting change, as one of the most heavily used instrumentations, this would be a surprise to a lot of folks so at the most to start I would only want to see this as an opt-in scenario. |
Good point ! How do you feel about keeping the exception recording and also proper middleware execution times in and splitting off the nesting changes to another PR for discussion ? I assume the spans having meaningful durations should also be fairly uncontroversial, and it'll make splitting things much easier. |
Hmm... while I recognize that it's a bit more work, I think it is preferred to limit PRs to changing a single piece of functionality where possible. A big reason for that is if for some reason there is an unexpected side effect or issue, it can be harder to narrow down the piece of code responsible. So perhaps this ends up being 3 PRs then, and/or 2 PRs and an issue:
|
ad77e7c
to
f3cdae7
Compare
Force pushed a new version that only records exceptions. Will open the PR for span durations once main has these changes to avoid dealing with conflicts. |
@JamieDanielson @pkanal A revisit would be nice when you have some time :) |
Hi @Flarna @JamieDanielson @jessitron @pkanal any chance we can get this re-reviewed? It's important for our adoption of OTel :) |
Should be ready to merge |
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 is great, thanks so much for the code and the tests and the patience @raphael-theriault-swi ! Do you mind updating the PR description to show just this change, as you did with the title?
Thanks again 💥
Done ! |
Which problem is this PR solving?
Short description of the changes