Documentation ¶
Overview ¶
Package grpc is used for building observable 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 is used for creating interceptors with logging, metrics, and tracing for grpc clients.
func NewClientInterceptor ¶
func NewClientInterceptor(probe telemetry.Probe, opts Options) *ClientInterceptor
NewClientInterceptor creates a new observable client interceptor.
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 Options ¶
type Options struct {
ExcludedMethods []string
}
Options are optional configurations for interceptors.
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(probe telemetry.Probe, opts Options) *ServerInterceptor
NewServerInterceptor creates a new observable server interceptor.
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.