Skip to content

Commit

Permalink
Reformatted file
Browse files Browse the repository at this point in the history
  • Loading branch information
mpozniak95 committed Jun 27, 2024
1 parent 15e09d3 commit 4cb2415
Showing 1 changed file with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 4cb2415

Please sign in to comment.