@@ -543,9 +543,9 @@ public function testGetSpanContextWithMultipleTraceStates()
543543 '_dd.p.congo ' => 't61rcWkgMzE ' ,
544544 '_dd.p.some_val ' => 'tehehe '
545545 ]);
546- $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0;t. congo:t61rcWkgMzE;t.some_val:tehehe$/ ' , (string )$ span ->getContext ()->getTraceState ());
546+ $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.congo:t61rcWkgMzE;t.some_val:tehehe;t.dm:-0 $/ ' , (string )$ span ->getContext ()->getTraceState ());
547547 $ span ->end ();
548- $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0;t. congo:t61rcWkgMzE;t.some_val:tehehe$/ ' , (string )$ span ->getContext ()->getTraceState ());
548+ $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.congo:t61rcWkgMzE;t.some_val:tehehe;t.dm:-0 $/ ' , (string )$ span ->getContext ()->getTraceState ());
549549 });
550550
551551 $ span = $ traces [0 ][0 ];
@@ -589,7 +589,7 @@ public function testGetSpanContextWithRemoteParent(int $traceFlags, ?TraceState
589589 $ this ->assertSame ($ remoteContext ->getSpanId (), $ child ->getParentContext ()->getSpanId ());
590590 $ this ->assertFalse ($ childContext ->isRemote ()); // "When creating children from remote spans, their IsRemote flag MUST be set to false."
591591 $ this ->assertEquals (1 , $ childContext ->getTraceFlags ()); // RECORD_AND_SAMPLED ==> 01 (AlwaysOn sampler)
592- $ this ->assertSame (sprintf ( "dd=p:%016X;t.dm:-0 " , $ child ->getContext ()->getSpanID ()) . ($ traceState ? ", $ traceState " : "" ), (string )$ childContext ->getTraceState ());
592+ $ this ->assertSame ("dd=p: " . $ child ->getContext ()->getSpanID () . " ;t.dm:-0 " . ($ traceState ? ", $ traceState " : "" ), (string )$ childContext ->getTraceState ());
593593 });
594594
595595 $ span = $ traces [0 ][0 ];
@@ -678,7 +678,7 @@ public function getDescription(): string
678678 $ this ->assertFalse ($ childContext ->isRemote ()); // "When creating children from remote spans, their IsRemote flag MUST be set to false."
679679 $ this ->assertEquals (1 , $ childContext ->getTraceFlags ()); // RECORD_AND_SAMPLED ==> 01 (AlwaysOn sampler)
680680 $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0,localparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE$/ ' , (string )$ childContext ->getTraceState ());
681- $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0,localparent =yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE$/ ' , (string )$ parent ->getContext ()->getTraceState ());
681+ $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0;t.some_val:tehehe,root =yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE$/ ' , (string )$ parent ->getContext ()->getTraceState ());
682682
683683 $ grandChild = $ tracer ->spanBuilder ("grandChild " )
684684 ->setParent (Context::getCurrent ()->withContextValue ($ child ))
@@ -812,7 +812,7 @@ public function getDescription(): string
812812 $ grandChild = $ tracer ->spanBuilder ("grandChild " )
813813 ->setParent (Context::getCurrent ()->withContextValue ($ child ))
814814 ->startSpan ();
815- $ expected_tracestate = sprintf ( "dd=p:%016X ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " , $ child -> getContext ()-> getSpanId ()) ;
815+ $ expected_tracestate = "dd=p: " . $ childContext -> getSpanId () . " ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " ;
816816 $ this ->assertSame ($ expected_tracestate , (string )$ child ->getContext ()->getTraceState ());
817817 $ grandChildScope = $ grandChild ->activate ();
818818
@@ -821,9 +821,9 @@ public function getDescription(): string
821821 $ this ->assertSame ($ child ->getContext ()->getSpanId (), $ grandChild ->getParentContext ()->getSpanId ());
822822 $ this ->assertFalse ($ grandChildContext ->isRemote ()); // "When creating children from remote spans, their IsRemote flag MUST be set to false."
823823 $ this ->assertEquals (1 , $ grandChildContext ->getTraceFlags ()); // RECORD_AND_SAMPLED ==> 01 (AlwaysOn sampler)
824- $ expected_tracestate =sprintf ( "dd=p:%016X ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " , $ child -> getSpanId ()) ;
824+ $ expected_tracestate = "dd=p: " . $ childContext -> getSpanId () . " ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " ;
825825 $ this ->assertSame ($ expected_tracestate , (string )$ child ->getContext ()->getTraceState ());
826- $ expected_tracestate =sprintf ( "dd=p:%016X ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " , $ grandChildContext -> getSpanId ()) ;
826+ $ expected_tracestate = "dd=p: " . $ grandChildContext -> getSpanId (). " ;t.dm:-0,remoteparent=yes,rojo=00f067aa0ba902b7,congo=t61rcWkgMzE " ;
827827 $ this ->assertSame ($ expected_tracestate , (string )$ grandChildContext ->getTraceState ());
828828
829829 $ grandChildScope ->detach ();
@@ -856,7 +856,7 @@ public function testAddItemToTracestate()
856856 '_dd.p.congo ' => 't61rcWkgMzE ' ,
857857 ]);
858858
859- $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0 ;t.congo:t61rcWkgMzE $/ ' , (string )$ span ->getContext ()->getTraceState ());
859+ $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.congo:t61rcWkgMzE ;t.dm:-0 $/ ' , (string )$ span ->getContext ()->getTraceState ());
860860
861861 $ traceState = $ span ->getContext ()->getTraceState ()->with ('rojo ' , '00f067aa0ba902b7 ' );
862862 $ context = SpanContext::create (
@@ -870,7 +870,7 @@ public function testAddItemToTracestate()
870870 ->setParent (Context::getCurrent ()->withContextValue (Span::wrap ($ context )))
871871 ->startSpan ();
872872
873- $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.dm:-0 ;t.congo:t61rcWkgMzE ,rojo=00f067aa0ba902b7$/ ' , (string )$ child ->getContext ()->getTraceState ());
873+ $ this ->assertRegularExpression ('/^dd=p:[0-9a-f]{16};t.congo:t61rcWkgMzE ;t.dm:-0 ,rojo=00f067aa0ba902b7$/ ' , (string )$ child ->getContext ()->getTraceState ());
874874
875875 $ child ->end ();
876876 $ span ->end ();
0 commit comments