diff --git a/extra/redisotel/tracing.go b/extra/redisotel/tracing.go index 40df5a202..0a1f3515d 100644 --- a/extra/redisotel/tracing.go +++ b/extra/redisotel/tracing.go @@ -30,6 +30,8 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error { rdb.AddHook(newTracingHook(connString, opts...)) return nil case *redis.ClusterClient: + rdb.AddHook(newTracingHook("", opts...)) + rdb.OnNewNode(func(rdb *redis.Client) { opt := rdb.Options() opts = addServerAttributes(opts, opt.Addr) @@ -38,6 +40,8 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error { }) return nil case *redis.Ring: + rdb.AddHook(newTracingHook("", opts...)) + rdb.OnNewNode(func(rdb *redis.Client) { opt := rdb.Options() opts = addServerAttributes(opts, opt.Addr)