diff --git a/ddtrace/contrib/trace_utils.py b/ddtrace/contrib/trace_utils.py index f168f7e271..5694ff6300 100644 --- a/ddtrace/contrib/trace_utils.py +++ b/ddtrace/contrib/trace_utils.py @@ -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,