Versions in this module Expand all Collapse all v0 v0.24.0 Jun 24, 2026 Changes in this version + var DefaultBuckets = []float64 + func ContextWithSpanContext(ctx context.Context, sc SpanContext) context.Context + func FormatTraceparent(sc SpanContext) string + func InjectHTTP(h http.Header, sc SpanContext) + type Counter interface + Add func(v float64) + Inc func() + Value func() float64 + type Gauge interface + Add func(v float64) + Dec func() + Inc func() + Set func(v float64) + Value func() float64 + type Histogram interface + Observe func(v float64) + Snapshot func() HistogramSnapshot + type HistogramSnapshot struct + Buckets []float64 + Count uint64 + Counts []uint64 + Sum float64 + type Meter interface + Counter func(name string, labels ...string) Counter + Gauge func(name string, labels ...string) Gauge + Histogram func(name string, buckets []float64, labels ...string) Histogram + type Recorder interface + Spans func() []SpanRecord + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Counter(name string, labels ...string) Counter + func (r *Registry) Gauge(name string, labels ...string) Gauge + func (r *Registry) Histogram(name string, buckets []float64, labels ...string) Histogram + type Span interface + Context func() SpanContext + End func() + RecordError func(err error) Span + SetAttr func(key string, value any) Span + SetStatus func(status SpanStatus, desc string) Span + type SpanContext struct + ParentID string + Sampled bool + SpanID string + TraceID string + func ExtractHTTP(h http.Header) (SpanContext, bool) + func ParseTraceparent(value string) (SpanContext, bool) + func SpanContextFromContext(ctx context.Context) (SpanContext, bool) + func (sc SpanContext) Valid() bool + type SpanRecord struct + Attrs map[string]any + Context SpanContext + Duration time.Duration + End time.Time + Err string + Name string + Start time.Time + Status SpanStatus + StatusMsg string + type SpanStatus int + const StatusError + const StatusOK + const StatusUnset + func (s SpanStatus) String() string + type Tracer interface + Start func(ctx context.Context, name string) (context.Context, Span) + func NewTracer(opts ...TracerOption) Tracer + type TracerOption func(*defaultTracer) + func WithRingCapacity(n int) TracerOption + func WithSpanLogger(l *slog.Logger) TracerOption