-
Notifications
You must be signed in to change notification settings - Fork 698
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
Support loggging grpc status details #637
Comments
Hi, thanks for your issue! I'm a little confused exactly what the proposal is here - are we talking about a new option, or some sort of automatic behaviour? Could you share an example of the API you'd like to see, what it would do, and alternatives you've considered? Thanks! |
I've encountered the same problem . I want to view error details in the logs since they contain useful information for debugging. However, I haven't found a clear way to configure a logging interceptor. It would be great to have a // ErrorToDetails is a function type that extracts details from an error.
// It allows logging of error details when needed.
type ErrorToDetails func(err error) Fields I'm unsure whether enabling such a function by default is a good idea, as error details might contain private information. |
Hi, |
I'd be happy to review a PR for this. |
Problem
GRPC status messages on the wire are protos and include a field called
details
that allows further protos to be attached to the results - see https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto#L91Example of such an additions are in the error_details.proto file https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
In particular,
ErrorInfo
can have extended error details and metadata that would be helpful to logIn v1, these could be extracted and added to the fields using the custom message producer option
Suggestion
Probably not a custom message producer like v1, but some kind of option to extend fields with error details or more generally with post-call fields
The text was updated successfully, but these errors were encountered: