Skip to content

grpc: Replace our use of tags

Patrick Steinhardt requested to merge pks-grpc-middleware-replace-tags into master

Throughout our codebase we have a bunch of callsites that rely on the tags injected by our requestinfohandler package in order to generically derive information about the current RPC call's context. This mechanism is fragile as it relies on string keys to extract the information, where it's not clear where the information actually comes from. Second, the tagging mechanism is going away in go-grpc-middleware v2.

This MR thus refactors our code such that the request handler will also inject the RequestInfo into the context. Callsites are then adapted to use information via this injected information instead of using the tags mechanism.

Like this, we only have a single user of the tagging mechanism which is the requestinfohandler itself, where the tags will end up in our logs as structured data. This will be replaced eventually when upgrading to go-grpc-middleware v2 by instead using the new logging.InjectFields() function that allows us to inject logging fields.

Merge request reports