Skip to content

Commit f9c0614

Browse files
author
Michal Cech
committed
close root node as optional
1 parent b203761 commit f9c0614

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/OpenTracing.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class OpenTracing extends \CApplicationComponent
1919
/** @var string id of sentry component */
2020
public $sentryId;
2121

22+
/** @var bool if root node should be closed on end request */
23+
public $closeRootNode = true;
24+
2225
/** @var Scope */
2326
private $rootScope;
2427

@@ -141,7 +144,9 @@ public function handleBeginRequestEvent(\CEvent $event)
141144
*/
142145
public function handleEndRequestEvent(\CEvent $event)
143146
{
144-
$this->rootScope->close();
147+
if ($this->closeRootNode) {
148+
$this->rootScope->close();
149+
}
145150
$this->tracer->flush();
146151
}
147152

0 commit comments

Comments
 (0)