grpc

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGrpcInternal = status.New(codes.Internal, "internal server error").Err()

Functions

func UnaryClientInterceptor

func UnaryClientInterceptor(ignore ...string) grpc.UnaryClientInterceptor

UnaryClientInterceptor input ctx assume that it contain telemetry instance as well as invoker already under our telemetry UnaryClientInterceptor implement:

  • recovery
  • detail log during errors (+ in recovery also)
  • measure execution time

Types

type MW

type MW struct {
	// contains filtered or unexported fields
}

func New

func New(log *tel.Telemetry) *MW

func (*MW) GrpcUnaryClientInterceptorAll

func (t *MW) GrpcUnaryClientInterceptorAll(ignore ...string) grpc.UnaryClientInterceptor

GrpcUnaryClientInterceptorAll setup recovery, metrics, tracing and debug option according goal of our framework Execution order:

  • opentracing injection via otgrpc.OpenTracingClientInterceptor
  • recovery, measure execution time + debug log via own UnaryClientInterceptor
  • metrics via metrics.UnaryClientInterceptor

func (*MW) GrpcUnaryServerInterceptor

func (t *MW) GrpcUnaryServerInterceptor(ignore ...string) grpc.UnaryServerInterceptor

GrpcUnaryServerInterceptor the most important create new telepresence instance + fill trace ids

implements:
* new telepresence instance
* fill trace ids
* recovery
* detail log during errors (+ in recovery also)
* measure execution time

func (*MW) UnaryClientInterceptorAll

func (t *MW) UnaryClientInterceptorAll(ignore ...string) grpc.UnaryServerInterceptor

UnaryClientInterceptorAll setup recovery, metrics, tracing and debug option according goal of our framework Execution order:otelgrpc

  • opentracing injection via otgrpc.OpenTracingServerInterceptor
  • ctx new instance, recovery, measure execution time + debug log via own GrpcUnaryServerInterceptor
  • metrics via metrics.UnaryServerInterceptor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL