Documentation
¶
Overview ¶
Package ogrpc is an observable grpc package. It can be used for building gRPC servers and clients that automatically report logs, metrics, and traces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServerStreamWithContext ¶
func ServerStreamWithContext(ctx context.Context, s grpc.ServerStream) grpc.ServerStream
ServerStreamWithContext returns a new grpc.ServerStream with a new context.
Types ¶
type ClientInterceptor ¶
type ClientInterceptor struct {
// contains filtered or unexported fields
}
ClientInterceptor creates interceptors with logging, metrics, and tracing for grpc clients.
func NewClientInterceptor ¶
func NewClientInterceptor(observer observer.Observer, opts Options) *ClientInterceptor
NewClientInterceptor creates a new server interceptor for observability.
func (*ClientInterceptor) DialOptions ¶
func (i *ClientInterceptor) DialOptions() []grpc.DialOption
DialOptions return grpc dial options for unary and stream interceptors. This can be used for making gRPC method calls observable via logging, metrics, tracing, etc.
type ServerInterceptor ¶
type ServerInterceptor struct {
// contains filtered or unexported fields
}
ServerInterceptor creates interceptors with logging, metrics, and tracing for grpc servers.
func NewServerInterceptor ¶
func NewServerInterceptor(observer observer.Observer, opts Options) *ServerInterceptor
NewServerInterceptor creates a new server interceptor for observability.
func (*ServerInterceptor) ServerOptions ¶
func (i *ServerInterceptor) ServerOptions() []grpc.ServerOption
ServerOptions return grpc server options for unary and stream interceptors. This can be used for making gRPC method handlers observable via logging, metrics, tracing, etc. It also observes and recovers panics that happened inside the method handlers.