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.