-
Notifications
You must be signed in to change notification settings - Fork 103
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
[Tracing Redesign][2/N] Implement tracing unary Interceptors #2304
base: dev-tracing-fix
Are you sure you want to change the base?
Conversation
|
defer span.Finish() | ||
|
||
err := h.Handle(ctx, req, resw) | ||
if appErrSetter, ok := resw.(interface{ IsApplicationError() bool }); ok { |
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.
The writer wrapper is probably still the right way to go with, the reasons are:
- We also want to get the
applicationErrorMeta
- For the case where yarpc dispatcher is not used (hence obs middleware is not used), the original writer doesn't have
IsApplicationError()
method at all.
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.
Moreover, IsApplicationError() is implemented only for tChannel it seems. So tag value won't be set for other transports.
span.SetTag("error.type", "application_error") | ||
return err | ||
} | ||
|
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.
Could we also check the ApplicationErrorMeta
as well to add more error details?
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 as a reminder, we may use name and code, but should not add details.
@@ -22,10 +22,15 @@ package tracinginterceptor | |||
|
|||
import ( | |||
"context" | |||
"go.uber.org/yarpc/transport/tchannel/tracing" |
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.
Please rebase to the fresh dev branch, I added linter for imports.
span.SetTag("error.type", "application_error") | ||
return err | ||
} | ||
|
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 as a reminder, we may use name and code, but should not add details.
defer span.Finish() | ||
|
||
err := h.Handle(ctx, req, resw) | ||
if appErrSetter, ok := resw.(interface{ IsApplicationError() bool }); ok { |
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.
Moreover, IsApplicationError() is implemented only for tChannel it seems. So tag value won't be set for other transports.
This PR introduces the unary interceptors in YARPC Go to improve the structure and functionality of tracing and middleware handling. The primary focus is on separating the unary interceptors to allow for specialized optimizations and cleaner handling of tracing operations.
Key Changes:
Introduced a dedicated UnaryInbound and UnaryOutbound middleware architecture, simplifying the tracing logic for unary requests.
Introduced inbound.go and outbound.go files to reflect the specialized unary middleware design, improving maintainability and reducing complexity.
Enhanced test coverage for the unary path, ensuring that all middleware logic is properly unit tested with specific focus on the flow of unary RPCs.
Updated helper methods for extracting and applying tracing tags to unary requests, ensuring clearer separation of concerns.