diff --git a/internal/databroker/server.go b/internal/databroker/server.go index 2980f14bd..5c4294a8f 100644 --- a/internal/databroker/server.go +++ b/internal/databroker/server.go @@ -21,7 +21,6 @@ import ( "github.com/pomerium/pomerium/internal/telemetry/trace" "github.com/pomerium/pomerium/pkg/cryptutil" "github.com/pomerium/pomerium/pkg/grpc/databroker" - "github.com/pomerium/pomerium/pkg/grpcutil" "github.com/pomerium/pomerium/pkg/storage" "github.com/pomerium/pomerium/pkg/storage/inmemory" "github.com/pomerium/pomerium/pkg/storage/redis" @@ -79,7 +78,6 @@ func (srv *Server) AcquireLease(ctx context.Context, req *databroker.AcquireLeas _, span := trace.StartSpan(ctx, "databroker.grpc.AcquireLease") defer span.End() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("name", req.GetName()). Dur("duration", req.GetDuration().AsDuration()). Msg("acquire lease") @@ -107,7 +105,6 @@ func (srv *Server) Get(ctx context.Context, req *databroker.GetRequest) (*databr _, span := trace.StartSpan(ctx, "databroker.grpc.Get") defer span.End() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("type", req.GetType()). Str("id", req.GetId()). Msg("get") @@ -135,7 +132,6 @@ func (srv *Server) Query(ctx context.Context, req *databroker.QueryRequest) (*da _, span := trace.StartSpan(ctx, "databroker.grpc.Query") defer span.End() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("type", req.GetType()). Str("query", req.GetQuery()). Int64("offset", req.GetOffset()). @@ -179,7 +175,6 @@ func (srv *Server) Put(ctx context.Context, req *databroker.PutRequest) (*databr record := req.GetRecord() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("type", record.GetType()). Str("id", record.GetId()). Msg("put") @@ -204,7 +199,6 @@ func (srv *Server) ReleaseLease(ctx context.Context, req *databroker.ReleaseLeas _, span := trace.StartSpan(ctx, "databroker.grpc.ReleaseLease") defer span.End() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("name", req.GetName()). Str("id", req.GetId()). Msg("release lease") @@ -227,7 +221,6 @@ func (srv *Server) RenewLease(ctx context.Context, req *databroker.RenewLeaseReq _, span := trace.StartSpan(ctx, "databroker.grpc.RenewLease") defer span.End() log.Debug(ctx). - Str("peer", grpcutil.GetPeerAddr(ctx)). Str("name", req.GetName()). Str("id", req.GetId()). Dur("duration", req.GetDuration().AsDuration()). @@ -280,7 +273,6 @@ func (srv *Server) Sync(req *databroker.SyncRequest, stream databroker.DataBroke defer cancel() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(stream.Context())). Uint64("server_version", req.GetServerVersion()). Uint64("record_version", req.GetRecordVersion()). Msg("sync") @@ -318,7 +310,6 @@ func (srv *Server) SyncLatest(req *databroker.SyncLatestRequest, stream databrok defer cancel() log.Info(ctx). - Str("peer", grpcutil.GetPeerAddr(stream.Context())). Str("type", req.GetType()). Msg("sync latest") diff --git a/pkg/grpcutil/grpcutil.go b/pkg/grpcutil/grpcutil.go index 25e0b5f06..e0ad1dca2 100644 --- a/pkg/grpcutil/grpcutil.go +++ b/pkg/grpcutil/grpcutil.go @@ -5,7 +5,6 @@ import ( "context" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/peer" "google.golang.org/protobuf/proto" ) @@ -55,15 +54,6 @@ func JWTFromGRPCRequest(ctx context.Context) (rawjwt string, ok bool) { return rawjwts[0], true } -// GetPeerAddr returns the peer address. -func GetPeerAddr(ctx context.Context) string { - p, ok := peer.FromContext(ctx) - if ok { - return p.Addr.String() - } - return "" -} - // GetTypeURL gets the TypeURL for a protobuf message. func GetTypeURL(msg proto.Message) string { // taken from the anypb package