Lookout contains two gRPC interceptors in the grpchelper package, see NewServer and DialContext in helper.go.
The Ctxlog interceptor requires that the analyzers also have these interceptors to pass around the log fields like this: lookoutd client -> analyzer server -> analyzer client -> lookoutd server.
If we move the Ctxtlog interceptor to this repo it probably makes sense to move also the Log interceptor, to have uniform logs for lookoutd and all the analyzers.
I'm not sure about extracting the util/ctxlog package to this repo. Maybe we just want to have methods to set and get map[string]interface{} in the context, using context.WithValue(), ctx.Value().
Ideally the python code should have the same functionality to get the log fields from the gRPC metadata.
Lookout contains two gRPC interceptors in the
grpchelperpackage, seeNewServerandDialContextin helper.go.The
Ctxloginterceptor requires that the analyzers also have these interceptors to pass around the log fields like this: lookoutd client -> analyzer server -> analyzer client -> lookoutd server.If we move the
Ctxtloginterceptor to this repo it probably makes sense to move also theLoginterceptor, to have uniform logs for lookoutd and all the analyzers.I'm not sure about extracting the
util/ctxlogpackage to this repo. Maybe we just want to have methods to set and getmap[string]interface{}in the context, usingcontext.WithValue(),ctx.Value().Ideally the python code should have the same functionality to get the log fields from the gRPC metadata.