Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional attributes for redis.search methods create_index, search #2635

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
191ef9d
Add wrappers for redis.search methods create_index, search, aggregate
mpozniak95 Jun 25, 2024
15e09d3
Skip creating span for redisearch methods in _traced_execute_command
mpozniak95 Jun 26, 2024
4cb2415
Reformatted file
mpozniak95 Jun 27, 2024
16d99e0
Add additional functional tests
mpozniak95 Jun 27, 2024
c53b08e
Merge remote-tracking branch 'origin/main' into redis_additional_attr…
mpozniak95 Aug 12, 2024
fd52a83
Merge branch 'main' into redis_additional_attributes
lzchen Aug 14, 2024
5507098
Change the span kind to client, add db.system attributes to added met…
mpozniak95 Aug 26, 2024
da7ae34
Reformat files
mpozniak95 Aug 26, 2024
5a1a1d5
Merge branch 'main' into redis_additional_attributes
lzchen Aug 26, 2024
748022a
Reformat files
mpozniak95 Aug 28, 2024
adc4263
Merge branch 'open-telemetry:main' into redis_additional_attributes
mpozniak95 Aug 28, 2024
59b7c91
Remove aggregate, and skip function, edit attributes in execute command
mpozniak95 Aug 28, 2024
7b5bd19
Merge branch 'main' into redis_additional_attributes
lzchen Aug 28, 2024
a9e5afc
Fix linter problems
mpozniak95 Aug 29, 2024
2ad9768
Merge remote-tracking branch 'origin/main' into redis_additional_attr…
mpozniak95 Aug 30, 2024
8c6c75d
Change name to _set_span_attribute_if_value, use constant for _FIELD_…
mpozniak95 Aug 30, 2024
23b2736
Remove useless return
mpozniak95 Aug 30, 2024
6bf2b22
Merge branch 'main' into redis_additional_attributes
lzchen Sep 4, 2024
ae5f1a3
Change docker image to redis-stack for redis docker tests
mpozniak95 Sep 16, 2024
87374e4
Merge branch 'main' into redis_additional_attributes
lzchen Sep 16, 2024
fb3ba66
Add span.is_recording check before adding additional parameters to spans
mpozniak95 Sep 17, 2024
c3fc628
Merge branch 'main' into redis_additional_attributes
lzchen Sep 18, 2024
cc52746
Add entry to changelog
mpozniak95 Sep 19, 2024
f889861
Merge branch 'main' into redis_additional_attributes
lzchen Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reformat files
  • Loading branch information
mpozniak95 committed Aug 26, 2024
commit da7ae34133598b103c8f181bcca35d5e3e98531f
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ def _traced_execute_pipeline(func, instance, args, kwargs):

def _traced_create_index(func, instance, args, kwargs):
span_name = "redis.create_index"
with tracer.start_as_current_span(span_name, kind=trace.SpanKind.CLIENT) as span:
with tracer.start_as_current_span(
span_name, kind=trace.SpanKind.CLIENT
) as span:
_set_span_attribute(
span,
SpanAttributes.DB_SYSTEM,
Expand All @@ -247,7 +249,9 @@ def _traced_create_index(func, instance, args, kwargs):
if fields:
field_attribute = ""
for field in fields:
field_attribute += f"Field(name: {field.name}, type: {field.args[0]});"
field_attribute += (
f"Field(name: {field.name}, type: {field.args[0]});"
)
_set_span_attribute(
span,
"redis.create_index.fields",
Expand All @@ -258,7 +262,9 @@ def _traced_create_index(func, instance, args, kwargs):

def _traced_search(func, instance, args, kwargs):
span_name = "redis.search"
with tracer.start_as_current_span(span_name, kind=trace.SpanKind.CLIENT) as span:
with tracer.start_as_current_span(
span_name, kind=trace.SpanKind.CLIENT
) as span:
_set_span_attribute(
span,
SpanAttributes.DB_SYSTEM,
Expand All @@ -285,7 +291,9 @@ def _traced_search(func, instance, args, kwargs):

def _traced_aggregate(func, instance, args, kwargs):
span_name = "redis.aggregate"
with tracer.start_as_current_span(span_name, kind=trace.SpanKind.CLIENT) as span:
with tracer.start_as_current_span(
span_name, kind=trace.SpanKind.CLIENT
) as span:
_set_span_attribute(
span,
SpanAttributes.DB_SYSTEM,
Expand Down