-
Notifications
You must be signed in to change notification settings - Fork 620
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
Log GRPC server errors #2541
Log GRPC server errors #2541
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2541 +/- ##
==========================================
- Coverage 66.79% 61.37% -5.42%
==========================================
Files 84 133 +49
Lines 11938 21746 +9808
==========================================
+ Hits 7974 13347 +5373
- Misses 3149 6962 +3813
- Partials 815 1437 +622 |
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.
Other than a logging field nitpick, LGTM
manager/manager.go
Outdated
// pass the call down into the grpc_prometheus interceptor | ||
err := grpc_prometheus.StreamServerInterceptor(srv, ss, info, handler) | ||
if err != nil { | ||
log.G(ss.Context()).WithField("method", info.FullMethod).WithError(err).Debug("error handling streaming rpc") |
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.
Nitpick - the unary interceptor uses the field rpc
, whereas this uses the field method
- we already use method
in a lot of our other logging, so would it make sense for this field to be rpc
as well?
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.
oh, idk what i did here... good catch.
Changes the grpc unary and stream interceptors to implement logging of errors returned by RPCs (while also letting the prometheus interceptors do their thing). The biggest motivation for this change is that if a client times out while a grpc method is happening, the client may not ever get an error from the server, but the server should hopefully log an error explaining why it couldn't handle the request (like what part it may have been blocked on). Signed-off-by: Drew Erny <[email protected]>
Changes the grpc unary and stream interceptors to implement logging of errors returned by RPCs (while also letting the prometheus interceptors do their thing).
The biggest motivation for this change is that if a client times out while a GRPC method is happening, the client may not ever get an error from the server, but the server should hopefully log an error explaining why it couldn't handle the request (like what part it may have been blocked on).