Skip to content

Commit

Permalink
Add any instrument attributes to their parent span
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Nov 1, 2024
1 parent 03e3641 commit 5839f50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ def wrap_with_span(*args, **kwargs):
)
attributes_dict[attribute] = str(func_arg)

# Add attributes to the current (parent) span before we start the child span
span = trace.get_current_span()
span.set_attributes(attributes_dict)

with tracer.start_as_current_span(
name, record_exception=record_exception, attributes=attributes_dict
):
Expand Down

0 comments on commit 5839f50

Please sign in to comment.