Skip to content

Commit 6add5dd

Browse files
committed
test(traces): a raw ASGI traceparent value continues the trace through the pipeline
1 parent 97fbb09 commit 6add5dd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎posthog/test/tracing/test_pipeline.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ def traceparent(self):
265265
pipeline, _, _ = make()
266266
assert pipeline.start_span("a", parent=Hostile()) is NOOP_SPAN
267267

268+
def test_continues_a_trace_from_a_raw_asgi_header_value(self):
269+
pipeline, _, _ = make()
270+
pipeline.start_span("a", parent=f"00-{TRACE_ID}-{SPAN_ID}-01".encode()).end()
271+
assert queued(pipeline)[0].trace_id == TRACE_ID
272+
assert queued(pipeline)[0].parent_span_id == SPAN_ID
273+
268274
def test_continues_a_trace_from_a_one_element_header_list(self):
269275
pipeline, _, _ = make()
270276
pipeline.start_span("a", parent=[f"00-{TRACE_ID}-{SPAN_ID}-01"]).end()

0 commit comments

Comments
 (0)