tracing

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextTraceID

func GetContextTraceID(ctx context.Context) string

func InitTracer

func InitTracer(config SpanConfig) error

Types

type SpanAttributeKey

type SpanAttributeKey string
const (
	ComponentKey SpanAttributeKey = "component"
	LevelKey     SpanAttributeKey = "level"
	ErrorKey     SpanAttributeKey = "error"
	TraceIDKey   SpanAttributeKey = "trace_id"
	SpanIDKey    SpanAttributeKey = "span_id"
)

type SpanConfig

type SpanConfig struct {
	ServiceName    string
	ServiceVersion string
	SampleRate     float64
	TraceExport    bool
}

type TraceSpan

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

func CreateSpan

func CreateSpan(ctx context.Context, name string) (context.Context, *TraceSpan)

func (*TraceSpan) End

func (s *TraceSpan) End()

func (*TraceSpan) GetTraceID

func (s *TraceSpan) GetTraceID() string

func (*TraceSpan) SetAttributes

func (s *TraceSpan) SetAttributes(keyValues ...string)

func (*TraceSpan) SetError

func (s *TraceSpan) SetError(err error)

func (*TraceSpan) SetStatus

func (s *TraceSpan) SetStatus(code codes.Code, description string)

type Tracer

type Tracer struct {
}

Jump to

Keyboard shortcuts

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