Add gRPC logging middleware

Part of https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/519

This adds a GRPC server interceptor that writes JSON log messages to a Ruby IO object (typically an open file in O_APPEND mode).

The intended application is gitaly-ruby. The format of the messages is meant to blend in with those generated by https://github.com/grpc-ecosystem/go-grpc-middleware/tree/master/logging/logrus because that is what Gitaly uses for its gRPC access logs.

Example output:

{"grpc.time_ms":0.285,"grpc.code":"OK","grpc.method":"ReqResMethod","grpc.service":"labkit_test.TestService","pid":73129,"correlation_id":"(missing)","time":"2020-10-16T14:13:41.339Z"}
Edited by Jacob Vosmaer

Merge request reports

Loading
Loading