etrace

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// String ...
	String = attribute.String
)

Functions

func CompatibleExtractGrpcTraceID

func CompatibleExtractGrpcTraceID(header metadata.MD)

CompatibleExtractGrpcTraceID ... Deprecated 该方法会在v1.2.0移除

func CompatibleExtractHTTPTraceID

func CompatibleExtractHTTPTraceID(header http.Header)

CompatibleExtractHTTPTraceID ... Deprecated 该方法会在v1.2.0移除

func CompatibleParse

func CompatibleParse(traceID string) string

CompatibleParse ... opentrace: 18af9db18a77f4b7:18af9db18a77f4b7:0000000000000000:0 opentelemetry: 00-18af9db18a77f4b718af9db18a77f4b7-18af9db18a77f4b7-00 https://www.w3.org/TR/trace-context/

func CustomTag

func CustomTag(key string, val string) attribute.KeyValue

CustomTag ...

func ExtractTraceID

func ExtractTraceID(ctx context.Context) string

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

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)

SetGlobalTracer ...

Types

type Option

type Option func(*options)

Option is tracing option.

type Tracer

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

Tracer is otel span tracer

func NewTracer

func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer

NewTracer create tracer instance

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, operation string, carrier propagation.TextMapCarrier, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Start start tracing span

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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