Skip to content

Commit 1c8f20f

Browse files
authored
Improvement: Don't overwrite trace ID if it's present in the headers … (#165)
1 parent e6e8482 commit 1c8f20f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

conjure_python_client/_http/requests_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def _add_trace_id(kwargs: Dict[str, Any]) -> None:
158158
# Adds the trace ID to the arguments
159159
if "headers" not in kwargs:
160160
kwargs["headers"] = {}
161-
kwargs["headers"][TRACE_ID_HEADER] = fresh_trace_id()
161+
if not kwargs["headers"].get(TRACE_ID_HEADER):
162+
kwargs["headers"][TRACE_ID_HEADER] = fresh_trace_id()
162163

163164

164165
class RetryWithJitter(Retry):

0 commit comments

Comments
 (0)