in src/Backend/src/api/tracing.py [0:0]
def get_trace_id(self) -> str:
"""
Get the trace ID for the current context.
"""
# get the trace id from the current context, not the propagated one
span_context = trace.get_current_span().get_span_context()
if span_context.is_valid:
# should always get here, as we expect to use this while in a span
trace_id = trace.format_trace_id(span_context.trace_id)
else:
trace_id = self._get_current_request_id()
return trace_id