openTelemetry

package
v0.0.0-...-1ab66c2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTraceIdFromContext

func GetTraceIdFromContext(ctx context.Context) string

func IsRun

func IsRun() bool

func Log

func Log(span trace.Span, message string)

func Shutdown

func Shutdown(tp *tracesdk.TracerProvider)

func Tag

func Tag(span trace.Span, key, value string)

func Tracer

func Tracer(name ...string) trace.Tracer

Tracer 获取注册的 Tracer Example: tracer := Tracer() ctx, span := tracer.Start(ctx,"uuid.service") ... span.End()

Types

type Option

type Option func(*Options)

func Auth

func Auth(auth string) Option

func FileLog

func FileLog(toggle bool) Option

func ServiceName

func ServiceName(serviceName string) Option

func TraceLog

func TraceLog(toggle bool) Option

func TraceUrl

func TraceUrl(url string) Option

type Options

type Options struct {
	Name string `json:"name" mapstructure:"name"`
	Url  string `json:"url" mapstructure:"url"`
	Auth string `json:"auth" mapstructure:"auth"`
	Log  struct {
		Trace bool `json:"trace" mapstructure:"trace"`
		File  bool `json:"file" mapstructure:"file"`
	} `json:"log" mapstructure:"log"`
}

func NewOptions

func NewOptions(opts ...Option) Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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