envoy: use envoy request id for logging across systems with http and gRPC (#691)

This commit is contained in:
Caleb Doxsey 2020-05-12 06:55:55 -06:00 committed by Travis Groth
parent 593c47f8ac
commit 41855e5419
16 changed files with 228 additions and 253 deletions

View file

@ -14,6 +14,7 @@ import (
"github.com/pomerium/pomerium/config"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/telemetry/requestid"
)
type versionedOptions struct {
@ -58,7 +59,10 @@ func NewServer() (*Server, error) {
if err != nil {
return nil, err
}
srv.GRPCServer = grpc.NewServer()
srv.GRPCServer = grpc.NewServer(
grpc.UnaryInterceptor(requestid.UnaryServerInterceptor()),
grpc.StreamInterceptor(requestid.StreamServerInterceptor()),
)
reflection.Register(srv.GRPCServer)
srv.registerXDSHandlers()
srv.registerAccessLogHandlers()