etrace

package
Version: v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 Imported by: 12

README

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CompatibleExtractGrpcTraceID added in v0.8.0

func CompatibleExtractGrpcTraceID(header metadata.MD)

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

func CompatibleExtractHTTPTraceID added in v0.8.0

func CompatibleExtractHTTPTraceID(header http.Header)

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

func CompatibleParse added in v0.8.0

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 added in v0.3.6

func ExtractTraceID(ctx context.Context) string

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

func IsGlobalTracerRegistered added in v0.8.0

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 added in v0.8.0

type Option func(*options)

Option is tracing option.

type Tracer added in v0.8.0

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

Tracer is otel span tracer

func NewTracer added in v0.8.0

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

NewTracer create tracer instance

func (*Tracer) Start added in v0.8.0

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