Documentation
¶
Overview ¶
Package otelstore instruments any storage.Adapter with OpenTelemetry.
It wraps the transaction seam rather than any one implementation, so a third-party adapter gets the same timings as sqlitestore without writing them itself, and so the numbers mean the same thing across adapters: everything the caller waited for, including whatever the adapter did internally to serve the request.
It lives in its own package so that storage, which every adapter implementation imports, stays free of the OpenTelemetry dependency.
store, err := sqlitestore.Open(path) … instrumented, err := otelstore.Wrap(store) … srv, err := server.New(instrumented, …)
Wrap once, at the root. A Manager partitions the root adapter per app with prefixstore, which forwards to what it wraps, so one call at the root instruments every app — wrapping again per app would double-count.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config)
Option configures Wrap.
func WithMeterProvider ¶
func WithMeterProvider(mp metric.MeterProvider) Option
WithMeterProvider sets the meter provider (default: the global one, no-op until an SDK is installed).
func WithTracerProvider ¶
func WithTracerProvider(tp trace.TracerProvider) Option
WithTracerProvider sets the tracer provider (default: the global one, no-op until an SDK is installed).