Documentation
¶
Overview ¶
Package otelmemcache provides an OpenTelemetry adapter for the memcache client. It implements memcache.Observer, emitting a client span per operation. Wire it in via Config.Observer:
cfg := memcache.Config{Observer: otelmemcache.New(tracerProvider)}
It is a separate module so the OpenTelemetry dependency tree does not leak into consumers of the core memcache package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(tp trace.TracerProvider, opts ...Options) memcache.Observer
New returns a memcache.Observer that emits one client span per operation using tp. If tp is nil, the global TracerProvider is used.
opts accepts at most one Options value; the variadic form keeps the common call site free of an empty struct, and passing more is a programming error.
Types ¶
type Options ¶
type Options struct {
// RecordKeys records each operation's key as the db.operation.parameter.key
// span attribute. It is off by default because keys can be
// high-cardinality or carry PII; only enable it when your keys are safe to
// export to your tracing backend.
RecordKeys bool
}
Options configures the Observer returned by New. The zero value emits one span per operation without the key, which is the usual choice.