A fork of go-redis/extra/redisotel/v9 that follows Semantic Conventions v1.30.
go get github.com/wzy9607/goredisotel
Tracing is enabled by adding a hook:
import (
"github.com/redis/go-redis/v9"
"github.com/wzy9607/goredisotel"
)
rdb := rdb.NewClient(&rdb.Options{...})
// Enable tracing and metrics instrumentation.
if err := goredisotel.InstrumentClientWithHooks(rdb); err != nil {
panic(err)
}
// Enable tracing instrumentation only.
if err := goredisotel.InstrumentClientWithHooks(rdb, goredisotel.DisableMetrics()); err != nil {
panic(err)
}
// Enable pool statistics metrics instrumentation.
if err := goredisotel.InstrumentPoolStatsMetrics(rdb); err != nil {
panic(err)
}
See example for details.