Versions in this module Expand all Collapse all v0 v0.25.2 Jun 5, 2025 Changes in this version + const SpanKindTagKey + var EnableActiveSpansRegistry = settings.RegisterBoolSetting(settings.ApplicationLevel, "trace.span_registry.enabled", ...) + var WithClientSpanKind = WithSpanKind(oteltrace.SpanKindClient) + var WithServerSpanKind = WithSpanKind(oteltrace.SpanKindServer) + var ZipkinCollector = settings.RegisterStringSetting(settings.ApplicationLevel, "trace.zipkin.collector", ..., ...) + func AggregatorEventToBytes(_ context.Context, event AggregatorEvent) ([]byte, error) + func CheckRecordedSpans(rec tracingpb.Recording, expected string) error + func ContextWithRecordingSpan(ctx context.Context, tr *Tracer, opName string) (_ context.Context, finishAndGetRecording func() tracingpb.Recording) + func ContextWithSpan(ctx context.Context, sp *Span) context.Context + func CountLogMessages(sp tracingpb.RecordedSpan, msg string) int + func FindMsgInRecording(recording tracingpb.Recording, msg string) int + func LogsContainMsg(sp tracingpb.RecordedSpan, msg string) bool + func RedactAndTruncateError(err error) string + func RegisterTagRemapping(logTag, spanTag string) + func SpanInclusionFuncForClient(parent *Span) bool + func SpanInclusionFuncForServer(t *Tracer, spanMeta SpanMeta) bool + func TraceToJSON(trace tracingpb.Recording) (string, error) + type AggregatorEvent interface + Combine func(other AggregatorEvent) + Identity func() AggregatorEvent + ProtoName func() string + String func() string + type Carrier interface + ForEach func(fn func(key, val string) error) error + Set func(key, val string) + type EventConsumptionStatus int + const EventConsumed + const EventNotConsumed + type EventListener interface + Notify func(event Structured) EventConsumptionStatus + type LazyTag interface + Render func() []attribute.KeyValue + type MapCarrier struct + Map map[string]string + func (c MapCarrier) ForEach(fn func(key, val string) error) error + func (c MapCarrier) Set(key, val string) + type MetadataCarrier struct + func (w MetadataCarrier) ForEach(fn func(key, val string) error) error + func (w MetadataCarrier) Set(key, val string) + type RegistrySpan interface + GetFullRecording func(recType tracingpb.RecordingType) Trace + RecordingType func() tracingpb.RecordingType + SetRecordingType func(to tracingpb.RecordingType) + SpanID func() tracingpb.SpanID + TraceID func() tracingpb.TraceID + type SnapshotID int + type SnapshotInfo struct + CapturedAt time.Time + ID SnapshotID + type Span struct + func ChildSpan(ctx context.Context, opName string, os ...SpanOption) (context.Context, *Span) + func EnsureChildSpan(ctx context.Context, tr *Tracer, name string, os ...SpanOption) (context.Context, *Span) + func EnsureForkSpan(ctx context.Context, tr *Tracer, opName string) (context.Context, *Span) + func ForkSpan(ctx context.Context, opName string) (context.Context, *Span) + func SpanFromContext(ctx context.Context) *Span + func (sp *Span) Finish() + func (sp *Span) FinishAndGetConfiguredRecording() tracingpb.Recording + func (sp *Span) FinishAndGetRecording(recType tracingpb.RecordingType) tracingpb.Recording + func (sp *Span) FinishAndGetTraceRecording(recType tracingpb.RecordingType) Trace + func (sp *Span) GetConfiguredRecording() tracingpb.Recording + func (sp *Span) GetFullTraceRecording(recType tracingpb.RecordingType) Trace + func (sp *Span) GetLazyTag(key string) (interface{}, bool) + func (sp *Span) GetRecording(recType tracingpb.RecordingType) tracingpb.Recording + func (sp *Span) GetTraceRecording(recType tracingpb.RecordingType) Trace + func (sp *Span) ImportRemoteRecording(remoteRecording tracingpb.Recording) + func (sp *Span) ImportTrace(trace Trace) + func (sp *Span) IsSterile() bool + func (sp *Span) IsVerbose() bool + func (sp *Span) MaybeRecordStackHistory(since time.Time) + func (sp *Span) Meta() SpanMeta + func (sp *Span) OperationName() string + func (sp *Span) Record(msg string) + func (sp *Span) RecordStructured(item Structured) + func (sp *Span) Recordf(format string, args ...interface{}) + func (sp *Span) RecordingType() tracingpb.RecordingType + func (sp *Span) Redactable() bool + func (sp *Span) SetLazyTag(key string, value interface{}) + func (sp *Span) SetLazyTagLocked(key string, value interface{}) + func (sp *Span) SetOtelStatus(code codes.Code, msg string) + func (sp *Span) SetRecordingType(to tracingpb.RecordingType) + func (sp *Span) SetTag(key string, value attribute.Value) + func (sp *Span) SpanID() tracingpb.SpanID + func (sp *Span) String() string + func (sp *Span) TraceID() tracingpb.TraceID + func (sp *Span) Tracer() *Tracer + func (sp *Span) UpdateGoroutineIDToCurrent() + type SpanMeta struct + func SpanMetaFromProto(info tracingpb.TraceInfo) SpanMeta + func (sm SpanMeta) Empty() bool + func (sm SpanMeta) String() string + func (sm SpanMeta) ToProto() *tracingpb.TraceInfo + type SpanOption interface + func WithDetachedRecording() SpanOption + func WithEventListeners(eventListeners ...EventListener) SpanOption + func WithFollowsFrom() SpanOption + func WithForceRealSpan() SpanOption + func WithLogTags(tags *logtags.Buffer) SpanOption + func WithParent(sp *Span) SpanOption + func WithRecording(recType tracingpb.RecordingType) SpanOption + func WithRemoteParentFromLocalSpan(sp *Span) SpanOption + func WithRemoteParentFromSpanMeta(parent SpanMeta) SpanOption + func WithRemoteParentFromTraceInfo(ti *tracingpb.TraceInfo) SpanOption + func WithSpanKind(kind oteltrace.SpanKind) SpanOption + func WithSterile() SpanOption + type SpanRegistry struct + func (r *SpanRegistry) VisitRoots(visitor func(span RegistrySpan) error) error + func (r *SpanRegistry) VisitSpans(visitor func(span RegistrySpan)) + type SpanReusePercentOpt uint + type SpansSnapshot struct + CapturedAt time.Time + Err error + Stacks map[int]string + Traces []tracingpb.Recording + type Structured interface + type T interface + Fatalf func(format string, args ...interface{}) + type Trace struct + Children []Trace + DroppedDirectChildren bool + DroppedIndirectChildren bool + NumSpans int + Root tracingpb.RecordedSpan + StructuredRecordsSizeBytes int64 + func MakeTrace(root tracingpb.RecordedSpan) Trace + func (t *Trace) Empty() bool + func (t *Trace) Flatten() []tracingpb.RecordedSpan + func (t *Trace) PartialClone() Trace + func (t *Trace) String() string + func (t *Trace) ToRecording() tracingpb.Recording + type Tracer struct + func NewTracer() *Tracer + func NewTracerWithOpt(ctx context.Context, opts ...TracerOption) *Tracer + func (t *Tracer) ActiveSpansRegistryEnabled() bool + func (t *Tracer) AlwaysTrace() bool + func (t *Tracer) Close() + func (t *Tracer) ExtractMetaFrom(carrier Carrier) (SpanMeta, error) + func (t *Tracer) GetActiveSpanByID(spanID tracingpb.SpanID) RegistrySpan + func (t *Tracer) GetActiveSpansRegistry() *SpanRegistry + func (t *Tracer) GetAutomaticSnapshot(id SnapshotID) (SpansSnapshot, error) + func (t *Tracer) GetAutomaticSnapshots() []SnapshotInfo + func (t *Tracer) GetSnapshot(id SnapshotID) (SpansSnapshot, error) + func (t *Tracer) GetSnapshots() []SnapshotInfo + func (t *Tracer) HasExternalSink() bool + func (t *Tracer) InjectMetaInto(sm SpanMeta, carrier Carrier) + func (t *Tracer) PanicOnUseAfterFinish() bool + func (t *Tracer) PeriodicSnapshotsLoop(sv *settings.Values, done <-chan struct{}) + func (t *Tracer) Redactable() bool + func (t *Tracer) SaveAutomaticSnapshot() SnapshotInfo + func (t *Tracer) SaveSnapshot() SnapshotInfo + func (t *Tracer) SetActiveSpansRegistryEnabled(to bool) + func (t *Tracer) SetOpenTelemetryTracer(tr oteltrace.Tracer) + func (t *Tracer) SetRedactable(to bool) + func (t *Tracer) ShouldRecordAsyncSpans() bool + func (t *Tracer) SpanRegistry() *SpanRegistry + func (t *Tracer) StartSpan(operationName string, os ...SpanOption) *Span + func (t *Tracer) StartSpanCtx(ctx context.Context, operationName string, os ...SpanOption) (context.Context, *Span) + func (t *Tracer) TestingGetStatsAndReset() (int, int) + func (t *Tracer) TestingRecordAsyncSpans() + func (t *Tracer) VisitSpans(visitor func(span RegistrySpan) error) error + type TracerOption interface + func WithClusterSettings(sv *settings.Values) TracerOption + func WithSpanReusePercent(percent uint32) TracerOption + func WithTestingKnobs(knobs TracerTestingKnobs) TracerOption + func WithTracingMode(opt TracingMode) TracerOption + func WithUseAfterFinishOpt(panicOnUseAfterFinish, debugUseAfterFinish bool) TracerOption + type TracerTestingKnobs struct + Clock timeutil.TimeSource + MaintainAllocationCounters bool + ReleaseSpanToPool func(*Span) bool + UseNetTrace bool + type TracingAggregator struct + func TracingAggregatorForContext(ctx context.Context) *TracingAggregator + func (b *TracingAggregator) ForEachAggregatedEvent(f func(name string, event AggregatorEvent)) + func (b *TracingAggregator) Notify(event Structured) EventConsumptionStatus + type TracingMode int + const TracingModeActiveSpansRegistry + const TracingModeFromEnv + const TracingModeOnDemand