-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Close span instead of trace on router exception #37
Close span instead of trace on router exception #37
Conversation
SourceLevel has finished reviewing this Pull Request and has found:
|
This looks good to me. @GregMefford thoughts? |
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.
Spandex's internals aren't clear to me, so I'm not sure why finishing the span instead of the trace fixes things, but I'm happy if it does! This bug's been bugging me
Well, basically spandex hooks itself up to 2 types of telemtry events: "endpoint" events and "router" events, and the "endpoint start" event is used to start a trace, the "endpoint stop" event is used to attach common metadata as well as close the trace. The router events (start/stop/exception) are always emitted in between the endpoint start and endpoint stop. The "router start" event starts a new span, and stop/exception should close that span. The issue which this PR fixes is that currently the "exception" event closes the full trace instead of just closing the span, which means the "endpoint stop" event doesn't have a closable trace anymore and cannot attach metadata... |
Right, but does this then fix the problem where no error traces are showing up in datadog? (ps: it use to add metadata in exceptions as well, but phx had a bug where they didn't include the conn in an exception so that didn't work! they fixed that in 1.5.4 though) |
This PR solves exception traces not having the right tags, which includes the resource name (ie. for me exception traces were not grouped together with successful traces for the same resource); I also stumbled on another issue with traces not being "marked as errors", see #24 (comment) |
kaching. that makes a ton of sense as the reason why nothing was showing up. i thought no errors were being sent at all, but prompted by your comment i dug into Traces search on datadog and found them. many thanks! excited for this to get in |
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.
Just checked this against the internal equivalent that I've been using for this and confirmed this is correct! I also see that we have a couple more improvements internally that I can work on contributing here as a separate PR. 🚀
Oh and thank you all for finding this issue and taking the time to contribute a fix / peer-review each others' work, and everything! Y'all are great! ❤️ |
could we get a release with this? ❤️ ❤️ |
I'll build one. |
Released as |
zach you're a gosh damned hero, thanks man |
See #29 (comment)