@@ -10,7 +10,6 @@ import (
10
10
"github.com/go-redis/redis/v8/internal"
11
11
"github.com/go-redis/redis/v8/internal/pool"
12
12
"github.com/go-redis/redis/v8/internal/proto"
13
- "go.opentelemetry.io/otel/attribute"
14
13
)
15
14
16
15
// Nil reply returned by Redis when key does not exist.
@@ -237,9 +236,6 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
237
236
return nil
238
237
}
239
238
240
- ctx , span := internal .StartSpan (ctx , "redis.init_conn" )
241
- defer span .End ()
242
-
243
239
connPool := pool .NewSingleConnPool (c .connPool , cn )
244
240
conn := newConn (ctx , c .opt , connPool )
245
241
@@ -287,20 +283,11 @@ func (c *baseClient) releaseConn(ctx context.Context, cn *pool.Conn, err error)
287
283
func (c * baseClient ) withConn (
288
284
ctx context.Context , fn func (context.Context , * pool.Conn ) error ,
289
285
) error {
290
- ctx , span := internal .StartSpan (ctx , "redis.with_conn" )
291
- defer span .End ()
292
-
293
286
cn , err := c .getConn (ctx )
294
287
if err != nil {
295
288
return err
296
289
}
297
290
298
- if span .IsRecording () {
299
- if remoteAddr := cn .RemoteAddr (); remoteAddr != nil {
300
- span .SetAttributes (attribute .String ("net.peer.ip" , remoteAddr .String ()))
301
- }
302
- }
303
-
304
291
defer func () {
305
292
c .releaseConn (ctx , cn , err )
306
293
}()
0 commit comments