Help us shape the future of Go! Take the 2026 Go Developer Survey

otelmemcache

package module
v0.0.0-...-2f0df27 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 10 Imported by: 0

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.

Jump to

Keyboard shortcuts

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