@@ -341,7 +341,7 @@ func NewConn(netConn net.Conn, readTimeout, writeTimeout time.Duration) Conn {
341341}
342342
343343func (c * conn ) CloseContext (ctx context.Context ) error {
344- ctx , span := trace .StartSpan (ctx , "redis.(*Conn).Close" )
344+ ctx , span := trace .StartSpan (ctx , "redis.(*Conn).Close" , trace . WithSpanKind ( trace . SpanKindClient ) )
345345 if len (c .options .DefaultAttributes ) > 0 {
346346 span .AddAttributes (c .options .DefaultAttributes ... )
347347 }
@@ -618,7 +618,7 @@ func (c *conn) Send(cmd string, args ...interface{}) error {
618618}
619619
620620func (c * conn ) SendContext (ctx context.Context , cmd string , args ... interface {}) error {
621- _ , span := trace .StartSpan (ctx , "redis.(*Conn).Send" )
621+ _ , span := trace .StartSpan (ctx , "redis.(*Conn).Send" , trace . WithSpanKind ( trace . SpanKindClient ) )
622622 defer span .End ()
623623 if len (c .options .DefaultAttributes ) > 0 {
624624 span .AddAttributes (c .options .DefaultAttributes ... )
@@ -646,7 +646,7 @@ func (c *conn) SendContext(ctx context.Context, cmd string, args ...interface{})
646646func (c * conn ) FlushContext (ctx context.Context ) error {
647647 startTime := time .Now ()
648648 ctx , _ = tag .New (ctx , tag .Upsert (observability .KeyCommandName , "flush" ))
649- ctx , span := trace .StartSpan (ctx , "redis.(*Conn).Flush" )
649+ ctx , span := trace .StartSpan (ctx , "redis.(*Conn).Flush" , trace . WithSpanKind ( trace . SpanKindClient ) )
650650
651651 defer func () {
652652 // At the very end we need to record the overall latency
@@ -687,7 +687,7 @@ func (c *conn) ReceiveWithTimeout(timeout time.Duration) (reply interface{}, err
687687}
688688
689689func (c * conn ) receive (ctx context.Context , timeout time.Duration ) (reply interface {}, err error ) {
690- _ , span := trace .StartSpan (ctx , "redis.(*Conn).Receive" )
690+ _ , span := trace .StartSpan (ctx , "redis.(*Conn).Receive" , trace . WithSpanKind ( trace . SpanKindClient ) )
691691 defer span .End ()
692692
693693 if len (c .options .DefaultAttributes ) > 0 {
@@ -756,7 +756,7 @@ func (c *conn) do(ctx context.Context, readTimeout time.Duration, cmd string, ar
756756
757757 startTime := time .Now ()
758758 ctx , _ = tag .New (ctx , tag .Upsert (observability .KeyCommandName , spanName ))
759- ctx , span := trace .StartSpan (ctx , "redis.(*Conn)." + spanName )
759+ ctx , span := trace .StartSpan (ctx , "redis.(*Conn)." + spanName , trace . WithSpanKind ( trace . SpanKindClient ) )
760760
761761 defer func () {
762762 // At the very end we need to record the overall latency
@@ -809,7 +809,7 @@ func (c *conn) do(ctx context.Context, readTimeout time.Duration, cmd string, ar
809809 }
810810 }()
811811
812- _ , readSpan := trace .StartSpan (ctx , "redis.(*Conn).readReplies" )
812+ _ , readSpan := trace .StartSpan (ctx , "redis.(*Conn).readReplies" , trace . WithSpanKind ( trace . SpanKindClient ) )
813813 defer readSpan .End ()
814814
815815 if len (c .options .DefaultAttributes ) > 0 {
0 commit comments