File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -75,21 +75,25 @@ public function addSpan($span)
7575
7676 /**
7777 * Save trace
78+ *
79+ * @param $unsetParentId bool are you frontend?
7880 */
79- public function trace ()
81+ public function trace ($ unsetParentId = true )
8082 {
8183 if (!TracerInfo::isSampled ()) {
8284 return ;
8385 }
8486
85- $ this ->addTraceSpan ();
87+ $ this ->addTraceSpan ($ unsetParentId );
8688 $ this ->logger ->trace ($ this ->spans );
8789 }
8890
8991 /**
9092 * Adds main span to Spans
93+ *
94+ * @param $unsetParentId bool are you frontend?
9195 */
92- protected function addTraceSpan ()
96+ protected function addTraceSpan ($ unsetParentId = true )
9397 {
9498 $ span = new Span (
9599 TracerInfo::getTraceSpanId (),
@@ -101,7 +105,9 @@ protected function addTraceSpan()
101105 AnnotationBlock::SERVER
102106 )
103107 );
104- $ span ->unsetParentId ();
108+ if ($ unsetParentId ) {
109+ $ span ->unsetParentId ();
110+ }
105111 $ this ->addSpan ($ span );
106112 }
107113
You can’t perform that action at this time.
0 commit comments