Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggerFromContext ¶
LoggerFromContext returns a logger set by grpc server interceptor on each incoming context
func ServerStreamWithContext ¶
func ServerStreamWithContext(stream grpc.ServerStream, ctx context.Context) grpc.ServerStream
ServerStreamWithContext return new grpc.ServerStream with a new context
Types ¶
type ClientObservabilityInterceptor ¶
type ClientObservabilityInterceptor struct {
// contains filtered or unexported fields
}
ClientObservabilityInterceptor is a gRPC client interceptor for logging, metrics, and tracing
func NewClientObservabilityInterceptor ¶
func NewClientObservabilityInterceptor(logger *log.Logger, mf *metrics.Factory, tracer opentracing.Tracer) *ClientObservabilityInterceptor
NewClientObservabilityInterceptor creates a new instance of gRPC server interceptor for observability
func (*ClientObservabilityInterceptor) StreamInterceptor ¶
func (i *ClientObservabilityInterceptor) StreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, fullMethod string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
StreamInterceptor is the gRPC StreamClientInterceptor for logging, metrics, and tracing
func (*ClientObservabilityInterceptor) UnaryInterceptor ¶
func (i *ClientObservabilityInterceptor) UnaryInterceptor(ctx context.Context, fullMethod string, req, res interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryInterceptor is the gRPC UnaryClientInterceptor for logging, metrics, and tracing
type ServerObservabilityInterceptor ¶
type ServerObservabilityInterceptor struct {
// contains filtered or unexported fields
}
ServerObservabilityInterceptor is a gRPC server interceptor for logging, metrics, and tracing
func NewServerObservabilityInterceptor ¶
func NewServerObservabilityInterceptor(logger *log.Logger, mf *metrics.Factory, tracer opentracing.Tracer) *ServerObservabilityInterceptor
NewServerObservabilityInterceptor creates a new instance of gRPC server interceptor for observability
func (*ServerObservabilityInterceptor) StreamInterceptor ¶
func (i *ServerObservabilityInterceptor) StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamInterceptor is the gRPC StreamServerInterceptor for logging, metrics, and tracing
func (*ServerObservabilityInterceptor) UnaryInterceptor ¶
func (i *ServerObservabilityInterceptor) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryInterceptor is the gRPC UnaryServerInterceptor for logging, metrics, and tracing