diff --git a/src/Trace/Integrations/Symfony.php b/src/Trace/Integrations/Symfony.php index c0b0e3a42..fb5bd9709 100644 --- a/src/Trace/Integrations/Symfony.php +++ b/src/Trace/Integrations/Symfony.php @@ -51,8 +51,11 @@ public static function load() ]; }); - // public function dispatch($eventName, Event $event = null) - opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $eventName) { + // public function dispatch($event/*, string $eventName = null*/); + opencensus_trace_method(EventDispatcher::class, 'dispatch', function ($dispatcher, $event, $eventName = null) { + if (!isset($eventName)) { + $eventName = \is_object($event) ? \get_class($event) : $event; + } return [ 'name' => $eventName, 'attributes' => ['eventName' => $eventName]