File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ public function getParentId(): int
4444 return $ this ->parentId ;
4545 }
4646
47+ public function isSampled (): bool
48+ {
49+ return (bool )($ this ->flags & 0x01 );
50+ }
51+
4752 public function isDebug (): bool
4853 {
4954 return (bool )($ this ->flags & 0x02 );
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ public function __construct(
3333 $ this ->flags = $ context ->getFlags ();
3434 $ this ->operationName = $ operationName ;
3535 $ this ->startTime = $ startTime ;
36-
3736 $ this ->tags = $ tags ;
3837 $ this ->logs = $ logs ;
3938 parent ::__construct ();
@@ -42,14 +41,11 @@ public function __construct(
4241 public function __destruct ()
4342 {
4443 if (null !== $ this ->duration ) {
45- return $ this ;
44+ return ;
4645 }
4746 $ this ->tags [] = new ErrorTag ();
4847 $ this ->tags [] = new OutOfScopeTag ();
49-
5048 $ this ->tracer ->finish ($ this );
51-
52- return $ this ;
5349 }
5450
5551 public function getContext (): ?SpanContext
@@ -59,7 +55,7 @@ public function getContext(): ?SpanContext
5955
6056 public function isSampled (): bool
6157 {
62- return ( bool )( $ this ->flags & 1 );
58+ return $ this ->context -> isSampled ( );
6359 }
6460
6561 public function start (int $ startTimeUsec ): SpanInterface
You can’t perform that action at this time.
0 commit comments