go-redis/redis · error
redisotel: %T not supported
Error message
redisotel: %T not supported
What it means
Error "redisotel: %T not supported" thrown in go-redis/redis.
Source
Thrown at extra/redisotel/tracing.go:49
return nil
case *redis.ClusterClient:
rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr)
connString := formatDBConnString(opt.Network, opt.Addr)
rdb.AddHook(newTracingHook(connString, opts...))
})
return nil
case *redis.Ring:
rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr)
connString := formatDBConnString(opt.Network, opt.Addr)
rdb.AddHook(newTracingHook(connString, opts...))
})
return nil
default:
return fmt.Errorf("redisotel: %T not supported", rdb)
}
}
type tracingHook struct {
conf *config
spanOpts []trace.SpanStartOption
}
var _ redis.Hook = (*tracingHook)(nil)
func newTracingHook(connString string, opts ...TracingOption) *tracingHook {
baseOpts := make([]baseOption, len(opts))
for i, opt := range opts {
baseOpts[i] = opt
}
conf := newConfig(baseOpts...)
View on GitHub (pinned to 36d97525cd)
Solutions
- Pass a *redis.Client (or a type implementing the traced interface) to redisotel tracing instrumentation
- For ClusterClient/Ring, use the instrumentation constructor that accepts those types
When it happens
Trigger: Thrown at extra/redisotel/tracing.go:49 when the library encounters an invalid state.
Common situations: Assert the concrete client type before instrumenting and fail during setup, not at first trace.
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/55bf588c0991e7df.json.
Report an issue: GitHub.