Skip to content

Commit

Permalink
Propagate sampling priority only if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
LotharSee committed Nov 8, 2017
1 parent 8142e3f commit 3412a6e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ddtrace/propagation/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def parent_call():
"""
headers[HTTP_HEADER_TRACE_ID] = str(span_context.trace_id)
headers[HTTP_HEADER_PARENT_ID] = str(span_context.span_id)
headers[HTTP_HEADER_SAMPLING_PRIORITY] = str(span_context.sampling_priority)
sampling_priority = span_context.sampling_priority
# Propagate priority only if defined
if sampling_priority is not None:
headers[HTTP_HEADER_SAMPLING_PRIORITY] = str(span_context.sampling_priority)

def extract(self, headers):
"""Extract a Context from HTTP headers into a new Context.
Expand Down

0 comments on commit 3412a6e

Please sign in to comment.