Allow adding grpc client name key value pair to output context
While working on adding correlation id when making grpc calls from gitlab-elasticsearch-indexer to gitaly, we realized there is no interface in golang code to set the client name on the client side. By looking it further, there seem two places we are using the client name,
-
Prometheus metrics. This seems to use the client name from incoming context, as shown in the gitaly code, https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/middleware/metadatahandler/metadatahandler.go
-
logs. This seems to be included in an outgoing context, similar as correlation id which is demonstrated in https://gitlab.com/gitlab-org/labkit/-/blob/master/correlation/grpc/client_interceptors.go#L40