mirror of https://github.com/go-redis/redis.git
fix(redisotel): fix the situation of reporting spans multiple times
This commit is contained in:
parent
cc9bcb0c0f
commit
cc4810cc5a
|
@ -30,8 +30,6 @@ 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)
|
||||
|
@ -40,8 +38,6 @@ 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)
|
||||
|
|
Loading…
Reference in New Issue