Compare commits

...

2 Commits

Author SHA1 Message Date
Flc゛ 7e6a725360
Merge cc4810cc5a into 930d904205 2024-11-13 16:01:18 +02:00
Flc cc4810cc5a fix(redisotel): fix the situation of reporting spans multiple times 2024-10-23 19:05:03 +08:00
1 changed files with 0 additions and 4 deletions

View File

@ -30,8 +30,6 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error {
rdb.AddHook(newTracingHook(connString, opts...)) rdb.AddHook(newTracingHook(connString, opts...))
return nil return nil
case *redis.ClusterClient: case *redis.ClusterClient:
rdb.AddHook(newTracingHook("", opts...))
rdb.OnNewNode(func(rdb *redis.Client) { rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options() opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr) opts = addServerAttributes(opts, opt.Addr)
@ -40,8 +38,6 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error {
}) })
return nil return nil
case *redis.Ring: case *redis.Ring:
rdb.AddHook(newTracingHook("", opts...))
rdb.OnNewNode(func(rdb *redis.Client) { rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options() opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr) opts = addServerAttributes(opts, opt.Addr)