@@ -10,7 +10,6 @@ import (
1010 "github.com/go-redis/redis/v8/internal"
1111 "github.com/go-redis/redis/v8/internal/pool"
1212 "github.com/go-redis/redis/v8/internal/proto"
13- "go.opentelemetry.io/otel/attribute"
1413)
1514
1615// 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 {
237236 return nil
238237 }
239238
240- ctx , span := internal .StartSpan (ctx , "redis.init_conn" )
241- defer span .End ()
242-
243239 connPool := pool .NewSingleConnPool (c .connPool , cn )
244240 conn := newConn (ctx , c .opt , connPool )
245241
@@ -287,20 +283,11 @@ func (c *baseClient) releaseConn(ctx context.Context, cn *pool.Conn, err error)
287283func (c * baseClient ) withConn (
288284 ctx context.Context , fn func (context.Context , * pool.Conn ) error ,
289285) error {
290- ctx , span := internal .StartSpan (ctx , "redis.with_conn" )
291- defer span .End ()
292-
293286 cn , err := c .getConn (ctx )
294287 if err != nil {
295288 return err
296289 }
297290
298- if span .IsRecording () {
299- if remoteAddr := cn .RemoteAddr (); remoteAddr != nil {
300- span .SetAttributes (attribute .String ("net.peer.ip" , remoteAddr .String ()))
301- }
302- }
303-
304291 defer func () {
305292 c .releaseConn (ctx , cn , err )
306293 }()
0 commit comments