@@ -390,6 +390,17 @@ def redis_operations():
390390 self .assertEqual (span .kind , SpanKind .CLIENT )
391391 self .assertEqual (span .status .status_code , trace .StatusCode .UNSET )
392392
393+ def test_span_name_empty_pipeline (self ):
394+ redis_client = fakeredis .FakeStrictRedis ()
395+ pipe = redis_client .pipeline ()
396+ pipe .execute ()
397+
398+ spans = self .memory_exporter .get_finished_spans ()
399+ self .assertEqual (len (spans ), 1 )
400+ self .assertEqual (spans [0 ].name , "redis" )
401+ self .assertEqual (spans [0 ].kind , SpanKind .CLIENT )
402+ self .assertEqual (spans [0 ].status .status_code , trace .StatusCode .UNSET )
403+
393404
394405class TestRedisAsync (TestBase , IsolatedAsyncioTestCase ):
395406 def assert_span_count (self , count : int ):
@@ -543,6 +554,22 @@ def response_hook(span, conn, args):
543554 await self .client .set ("key" , "value" )
544555 spans = self .assert_span_count (0 )
545556
557+ @pytest .mark .asyncio
558+ async def test_span_name_empty_pipeline (self ):
559+ redis_client = fakeredis .aioredis .FakeRedis ()
560+ self .instrumentor .instrument_client (
561+ client = redis_client , tracer_provider = self .tracer_provider
562+ )
563+ async with redis_client .pipeline () as pipe :
564+ await pipe .execute ()
565+
566+ spans = self .memory_exporter .get_finished_spans ()
567+ self .assertEqual (len (spans ), 1 )
568+ self .assertEqual (spans [0 ].name , "redis" )
569+ self .assertEqual (spans [0 ].kind , SpanKind .CLIENT )
570+ self .assertEqual (spans [0 ].status .status_code , trace .StatusCode .UNSET )
571+ self .instrumentor .uninstrument_client (client = redis_client )
572+
546573
547574class TestRedisInstance (TestBase ):
548575 def assert_span_count (self , count : int ):
0 commit comments