-
Notifications
You must be signed in to change notification settings - Fork 713
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
Span Error Handler #666
Span Error Handler #666
Conversation
For the sake of conventions, lets switch this to line up with the other parsers and use a default implementation. We've been using classes to prevent subtle changes from affecting people.. and basically everywhere we use interfaces has been difficult. Here's something I just ripped from HttpParser. Mind swapping out your interface for that? I don't think we need a noop as we already have noop span and this isn't done in the other parsers. public class ErrorParser {
/**
* Override to change what data from the error are parsed into the span modeling it. By
* default, this tags "error" as the message or simple name of the type.
*/
public void error(Throwable error, SpanCustomizer customizer) {
String message = message = error.getMessage();
if (message == null) message = error.getClass().getSimpleName();
customizer.tag("error", message);
}
} With this in place, the existing code can use it.. ex changing HttpParser, GrpcParser etc subtypes.. |
thanks for taking a crack at this.. has been on the mind for a long time @devinsba! |
discussed with @devinsba offline. I will take this on to try and help land this in time for sleuth's next RC. This means we can obviate more code there |
4bb6c16
to
cfccc28
Compare
made changes according to feedback so far. need some README updates etc |
ok I think I am done here. working on the startScopedSpan now |
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.
LGTM
Note: I added a commit to make this work with the new scoped span without forcing the latter to implement SpanCustomizer f1e3a0c |
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.
LGTM, had to reread the HttpTracing changes a couple times to understand what was going on at first, but it makes sense. Thanks for finishing this up for me.
Re HttpTracing: it wasn't clear at first that the lines overriding the errorParser were so the one configured in the Tracer is the one that is used instead of the default at first
f1e3a0c
to
9238139
Compare
here's WIP of sleuth consuming this feature spring-cloud/spring-cloud-sleuth#928 |
#684 for XML |
going out in 4.19.0 |
This supports the case where certain backend systems support errors as a first class object.
XRay supports encoding errors in their model directly. Having a configurable error handler in brave will allow a
zipkin-aws
functionality for storing them for reporting to the backend