Skip to content

Commit

Permalink
fix no span on execution context error
Browse files Browse the repository at this point in the history
  • Loading branch information
ZStriker19 committed Jan 9, 2025
1 parent b32a467 commit 837e213
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ddtrace/contrib/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,10 @@ def activate_distributed_headers(tracer, int_config=None, request_headers=None,
# app = Flask(__name__) # Traced via Flask instrumentation
# app = DDWSGIMiddleware(app) # Extra layer on top for WSGI
current_context = tracer.current_trace_context()
if current_context and current_context.trace_id and current_context.trace_id == context.trace_id:

# We accept incoming contexts with only baggage, however if we
# already have a current_context then a baggage only context will be tossed out
if current_context and (not context.trace_id or current_context.trace_id == context.trace_id):
log.debug(
"will not activate extracted Context(trace_id=%r, span_id=%r), a context with that trace id is already active", # noqa: E501
context.trace_id,
Expand Down

0 comments on commit 837e213

Please sign in to comment.