From 4cb24156905d4de3473edcfbae95699e17a4995e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Po=C5=BAniak?= Date: Thu, 27 Jun 2024 00:13:22 -0700 Subject: [PATCH] Reformatted file --- .../instrumentation/redis/__init__.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py index 2a3631bb75..e887e7323f 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py @@ -238,7 +238,7 @@ def _traced_create_index(func, instance, args, kwargs): ) response = func(*args, **kwargs) return response - + def _traced_search(func, instance, args, kwargs): span_name = "redis.search" with tracer.start_as_current_span(span_name) as span: @@ -250,20 +250,14 @@ def _traced_search(func, instance, args, kwargs): ) response = func(*args, **kwargs) _set_span_attribute( - span, - "redis.commands.search.total", - response.total + span, "redis.commands.search.total", response.total ) _set_span_attribute( - span, - "redis.commands.search.duration", - response.duration + span, "redis.commands.search.duration", response.duration ) for index, doc in enumerate(response.docs): _set_span_attribute( - span, - f"redis.commands.search.xdoc_{index}", - doc.__str__() + span, f"redis.commands.search.xdoc_{index}", doc.__str__() ) return response @@ -278,9 +272,7 @@ def _traced_aggregate(func, instance, args, kwargs): ) response = func(*args, **kwargs) _set_span_attribute( - span, - "redis.commands.aggregate.results", - str(response.rows) + span, "redis.commands.aggregate.results", str(response.rows) ) return response