trace

package
v0.0.0-...-0454926 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeysConfigPath      = "trace.labels"
	OtlpHostConfigPath  = "trace.otlp.host"
	OtlpPortConfigPath  = "trace.otlp.port"
	OtlpTokenConfigPath = "trace.otlp.token"
	// OtlpTypeConfigPath 上报模式,http,grpc
	OtlpTypeConfigPath = "trace.otlp.type"

	ServiceNameConfigPath = "trace.service_name"
	EnableConfigPath      = "trace.enable"
)
View Source
const (
	TracerName = "notes/notesBE"
)

Variables

View Source
var (
	OtlpType string

	ServiceName string
	Enable      bool
)

Functions

func InitConfig

func InitConfig()

InitConfig

Types

type Service

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

Service

func (*Service) Close

func (s *Service) Close()

Close

func (*Service) Reload

func (s *Service) Reload(ctx context.Context)

Reload

func (*Service) Start

func (s *Service) Start(ctx context.Context)

Start

func (*Service) Type

func (s *Service) Type() string

Type

func (*Service) Wait

func (s *Service) Wait()

Wait

type Span

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

func NewSpan

func NewSpan(ctx context.Context, name string) (context.Context, *Span)

NewSpan 新建一个 span

func (*Span) End

func (s *Span) End(errPoint *error)

End span end 增加错误异常判断

func (*Span) Set

func (s *Span) Set(key string, value any)

Set attribute 打点

func (*Span) TraceID

func (s *Span) TraceID() string

TraceID 获取 traceid

Jump to

Keyboard shortcuts

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