Documentation ¶
Index ¶
- Variables
- func AppendBaggageByMap(ctx context.Context, mp map[string]string) (context.Context, error)
- func ExtractTraceID(ctx context.Context) string
- func GetBaggageValue(ctx context.Context, key string) (string, bool)
- func IsGlobalTracerRegistered() bool
- func SetGlobalTracer(tp trace.TracerProvider)
- func WithBaggage(parent context.Context, key, val string) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // UnaryServerInterceptor is alias for otelgrpc.UnaryServerInterceptor. UnaryServerInterceptor = otelgrpc.UnaryServerInterceptor // StreamServerInterceptor is alias for otelgrpc.StreamServerInterceptor. StreamServerInterceptor = otelgrpc.StreamServerInterceptor )
View Source
var ( // UnaryClientInterceptor is alias for otelgrpc.UnaryClientInterceptor. UnaryClientInterceptor = otelgrpc.UnaryClientInterceptor // StreamClientInterceptor is alias for otelgrpc.StreamClientInterceptor. StreamClientInterceptor = otelgrpc.StreamClientInterceptor )
View Source
var ( // HTTPMiddleware is alias for telhttp.NewHandler. HTTPMiddleware = otelhttp.NewHandler )
View Source
var HTTPTransport = otelhttp.NewTransport
HTTPTransport is alias for otelhttp.NewTransport.
Functions ¶
func AppendBaggageByMap ¶
AppendBaggageByMap append map kvs to current ctx baggage, will return origin ctx if error.
func ExtractTraceID ¶
ExtractTraceID HTTP使用request.Context,不要使用错了.
func GetBaggageValue ¶
GetBaggageValue get baggage info from context, if key not exists, return "", false.
func IsGlobalTracerRegistered ¶
func IsGlobalTracerRegistered() bool
IsGlobalTracerRegistered returns a `bool` to indicate if a tracer has been globally registered.
func SetGlobalTracer ¶
func SetGlobalTracer(tp trace.TracerProvider)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.