tracing

package
v0.0.0-...-5117fa9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

func ToContext

func ToContext(ctx context.Context, traceId string) context.Context

append to context

func UnaryClientInterceptor

func UnaryClientInterceptor(cidFunc ClientTraceIdFunc) grpc.UnaryClientInterceptor

UnaryClientInterceptor returns a new unary client interceptor that optionally logs the execution of external gRPC calls.

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

全局跟踪ID,本方式用于在不启用operation tracer情况下,仍然可以跟踪整个请求. 客户端通过metadata向服务端传递

Types

type ClientTraceIdFunc

type ClientTraceIdFunc func(context.Context) (context.Context, error)

func DefaultClientTraceIdFunc

func DefaultClientTraceIdFunc(fromHttpHeader bool) ClientTraceIdFunc

support get string key from context.such as gin

Jump to

Keyboard shortcuts

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