From e5e6a9f79046b907d0da8c32ab576f08960a7d8f Mon Sep 17 00:00:00 2001 From: Becky Smith Date: Fri, 1 Nov 2024 12:14:35 +0000 Subject: [PATCH] Add any instrument attributes to their parent span --- services/tracing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/tracing.py b/services/tracing.py index 6cd6b179..c1db9a38 100644 --- a/services/tracing.py +++ b/services/tracing.py @@ -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 ):