From cc4810cc5a1ab4f502224b3bf297ad62226dfba6 Mon Sep 17 00:00:00 2001 From: Flc Date: Wed, 23 Oct 2024 19:05:03 +0800 Subject: [PATCH] fix(redisotel): fix the situation of reporting spans multiple times --- extra/redisotel/tracing.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extra/redisotel/tracing.go b/extra/redisotel/tracing.go index 3d5f3426..33b7abac 100644 --- a/extra/redisotel/tracing.go +++ b/extra/redisotel/tracing.go @@ -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)