Go-Redis Instrumentation
Setup
To instrument your Go-Redis code, you'll need to import the OpenTelemetry official instrumentation package:
shell
import "github.com/go-redis/redis/extra/redisotel/v9"
After initializing your Redis client, instrument tracing and metrics as in the example below.
go
rdb := redis.NewClient(&redis.Options{ Addr: "0.0.0.0:6379", }) if err := redisotel.InstrumentTracing(rdb); err != nil { panic(err) }