File tree Expand file tree Collapse file tree
tests/ext/distributed_tracing Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ --TEST--
2+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT: invalid value falls back to continue
3+ --ENV--
4+ DD_TRACE_GENERATE_ROOT_SPAN=0
5+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT=invalid_value
6+ --FILE--
7+ <?php
8+
9+ DDTrace \consume_distributed_tracing_headers ([
10+ "x-datadog-trace-id " => 42 ,
11+ "x-datadog-parent-id " => 10 ,
12+ ]);
13+
14+ $ span = DDTrace \start_span ();
15+ $ root = DDTrace \root_span ();
16+
17+ // invalid value falls back to default (continue): inherits upstream trace id
18+ echo "same_as_upstream: " . ($ root ->traceId === "0000000000000000000000000000002a " ? "yes " : "no " ) . "\n" ;
19+
20+ DDTrace \close_span ();
21+ ?>
22+ --EXPECT--
23+ same_as_upstream: yes
Original file line number Diff line number Diff line change 1+ --TEST--
2+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT: Ignore (mixed case) is accepted
3+ --ENV--
4+ DD_TRACE_GENERATE_ROOT_SPAN=0
5+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT=Ignore
6+ --FILE--
7+ <?php
8+
9+ DDTrace \consume_distributed_tracing_headers ([
10+ "x-datadog-trace-id " => 42 ,
11+ "x-datadog-parent-id " => 10 ,
12+ ]);
13+
14+ $ span = DDTrace \start_span ();
15+ $ root = DDTrace \root_span ();
16+
17+ echo "same_as_upstream: " . ($ root ->traceId === "0000000000000000000000000000002a " ? "yes " : "no " ) . "\n" ;
18+ echo "links_count: " . count ($ root ->links ) . "\n" ;
19+
20+ DDTrace \close_span ();
21+ ?>
22+ --EXPECT--
23+ same_as_upstream: no
24+ links_count: 0
Original file line number Diff line number Diff line change 1+ --TEST--
2+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT: CONTINUE (uppercase) is accepted
3+ --ENV--
4+ DD_TRACE_GENERATE_ROOT_SPAN=0
5+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT=CONTINUE
6+ --FILE--
7+ <?php
8+
9+ DDTrace \consume_distributed_tracing_headers ([
10+ "x-datadog-trace-id " => 42 ,
11+ "x-datadog-parent-id " => 10 ,
12+ ]);
13+
14+ $ span = DDTrace \start_span ();
15+ $ root = DDTrace \root_span ();
16+
17+ echo "same_as_upstream: " . ($ root ->traceId === "0000000000000000000000000000002a " ? "yes " : "no " ) . "\n" ;
18+
19+ DDTrace \close_span ();
20+ ?>
21+ --EXPECT--
22+ same_as_upstream: yes
Original file line number Diff line number Diff line change 1+ --TEST--
2+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT: RESTART (uppercase) is accepted
3+ --ENV--
4+ DD_TRACE_GENERATE_ROOT_SPAN=0
5+ DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT=RESTART
6+ --FILE--
7+ <?php
8+
9+ DDTrace \consume_distributed_tracing_headers ([
10+ "x-datadog-trace-id " => 42 ,
11+ "x-datadog-parent-id " => 10 ,
12+ ]);
13+
14+ $ span = DDTrace \start_span ();
15+ $ root = DDTrace \root_span ();
16+
17+ echo "same_as_upstream: " . ($ root ->traceId === "0000000000000000000000000000002a " ? "yes " : "no " ) . "\n" ;
18+ echo "links_count: " . count ($ root ->links ) . "\n" ;
19+
20+ DDTrace \close_span ();
21+ ?>
22+ --EXPECT--
23+ same_as_upstream: no
24+ links_count: 1
You can’t perform that action at this time.
0 commit comments