You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old grpc_ctxtags interceptor had an option WithFieldExtractorForInitialReq, to extract the tags from the first message passed from client to server.
For client-streams and bidirectional-streams, you can use WithFieldExtractorForInitialReq which will extract the tags from the first message passed from client to server. Note the tags will not be modified for subsequent requests, so this option only makes sense when the initial message establishes the meta-data for the stream.
– https://pkg.go.dev/github.com/grpc-ecosystem/go-grpc-middleware/tags#hdr-Request_Context_Tags
Now that grpc_ctxtags has been removed, what would be the right way to do this?
grpc_ctxtags interceptor was removed. Custom tags can be added to logging fields using logging.InjectFields. Proto option to add logging field was clunky in practice and we don't see any use of it nowadays, so it's removed.
The README mentions that logging.InjectFields should be used, but can it be used to add fields using the content of the first message received on a stream?
The text was updated successfully, but these errors were encountered:
I tried wrapping the stream, and setting the context of the wrapped stream in the RecvMsg on first message, but no luck, looks like the logging interceptor doesn't get the new context, even in the logging.FinishCall.
The old
grpc_ctxtags
interceptor had an optionWithFieldExtractorForInitialReq
, to extract the tags from the first message passed from client to server.Now that
grpc_ctxtags
has been removed, what would be the right way to do this?The README mentions that
logging.InjectFields
should be used, but can it be used to add fields using the content of the first message received on a stream?The text was updated successfully, but these errors were encountered: