tracing

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Baggage                 = "baggage"
	AttributeTraceID        = attribute.Key("trace.id")
	AttributeSpanID         = attribute.Key("span.id")
	AttributeLogID          = attribute.Key("log_id")
	AttributeRequest        = attribute.Key("request")
	AttributeResponse       = attribute.Key("response")
	AttributeGinError       = attribute.Key("gin.errors")
	AttributeRedisError     = attribute.Key("redis.cmd.error")
	AttributeRedisCmdName   = attribute.Key("redis.cmd.name")
	AttributeRedisCmdString = attribute.Key("redis.cmd.string")
	AttributeRedisCmdArgs   = attribute.Key("redis.cmd.args")
)
View Source
const (
	DefaultStdout = "stdout"
)
View Source
const (
	KeyErrMsg = "err_msg"
)

Variables

This section is empty.

Functions

func CheckHasTraceID added in v0.2.11

func CheckHasTraceID(ctx context.Context) bool

func ExtractHTTPBaggage added in v0.2.11

func ExtractHTTPBaggage(ctx context.Context, header http.Header) context.Context

func GetTraceId added in v0.2.11

func GetTraceId(ctx context.Context) string

GetTraceId return trace id in context

func InjectHTTPBaggage added in v0.2.11

func InjectHTTPBaggage(ctx context.Context, header http.Header)

func NewPrometheusMeterProvider added in v0.2.11

func NewPrometheusMeterProvider(config *Config) *sdkmetric.MeterProvider

func NewTracer added in v0.2.11

func NewTracer(config *Config) *sdktrace.TracerProvider

func SetIfCtxErr

func SetIfCtxErr(span oteltrace.Span, ctx context.Context)

SetIfCtxErr record context error

func SetIfErr

func SetIfErr(span oteltrace.Span, err error)

SetIfErr add error info

func SpanID added in v0.2.11

func SpanID(span oteltrace.Span) string

func TraceID added in v0.2.11

func TraceID(span oteltrace.Span) string

func TraceIdFromCtx added in v0.2.11

func TraceIdFromCtx(ctx context.Context) string

func Tracer added in v0.2.11

func Tracer() oteltrace.Tracer

Types

type Config added in v0.2.11

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

type Exporter added in v0.2.11

type Exporter struct {
	ExporterEndpoint string
	Insecure         bool
	Creds            credentials.TransportCredentials
}

type Provider added in v0.2.11

type Provider struct {
	TracerProvider oteltrace.TracerProvider
	Tracer         oteltrace.Tracer
	MeterProvider  otelmetric.MeterProvider
	Meter          otelmetric.Meter
}

func New added in v0.2.11

func New(cfg *Config, lc lifecycle.Lifecycle) Provider

type ServiceInfo added in v0.2.11

type ServiceInfo struct {
	Name      string
	Namespace string
	Version   string
}

Jump to

Keyboard shortcuts

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