etrace

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func AppendBaggageByMap(ctx context.Context, mp map[string]string) (context.Context, error)

AppendBaggageByMap append map kvs to current ctx baggage, will return origin ctx if error.

func ExtractTraceID

func ExtractTraceID(ctx context.Context) string

ExtractTraceID HTTP使用request.Context,不要使用错了.

func GetBaggageValue

func GetBaggageValue(ctx context.Context, key string) (string, bool)

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)

func WithBaggage

func WithBaggage(parent context.Context, key, val string) (context.Context, error)

WithBaggage append baggage by string key val.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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