Gomemcache instrumentation example
Quickstart
Install
otelmemcache:
go get go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache
Then use NewClientWithTracing
to wrap a client:
mc := otelmemcache.NewClientWithTracing(
memcache.New("localhost:11211"),
)
And use mc.WithContext
to propagate the active span.
Example
To run this example you need a memcached server. You can start one with Docker:
make up
Then run the example:
UPTRACE_DSN="https://<token>@api.uptrace.dev/<project_id>" go run main.go