traceutil

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package traceutil adapts framingo's explicit model.Tracer handle to the plain OpenTelemetry interfaces that third-party instrumentation expects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LiveProvider

func LiveProvider(t model.Tracer) trace.TracerProvider

LiveProvider adapts a model.Tracer into a trace.TracerProvider that re-resolves the real provider on every span instead of holding one.

Instrumentation libraries almost all take a TracerProvider and read provider.Tracer(...) once, at construction. Handing them model.Tracer's provider directly would pin their spans to whichever provider happened to be live at wiring time - and a tracing-service restart retires that one, which then drops every span it is given without erroring. Use this wherever a library wants a TracerProvider:

tracing.WithTracerProvider(traceutil.LiveProvider(t))

Start resolves through model.Tracer on each call, which costs a lock and a map lookup in the SDK's tracer cache. Immaterial at database-statement rates; worth measuring before putting it on a per-request path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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