コード例 #1
0
 /**
  * @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event
  *
  * @return void
  */
 public function onKernelController(FilterControllerEvent $event)
 {
     if (!$event->isMasterRequest()) {
         return;
     }
     $request = $event->getRequest();
     $transactionName = $request->attributes->get('_route');
     $requestUri = $request->server->get('REQUEST_URI', 'n/a');
     $host = $request->server->get('COMPUTERNAME', $this->system->getHostname());
     $this->newRelicApi->setNameOfTransaction($transactionName);
     $this->newRelicApi->addCustomParameter('request_uri', $requestUri);
     $this->newRelicApi->addCustomParameter('host', $host);
     if ($this->ignoreTransaction($transactionName)) {
         $this->newRelicApi->markIgnoreTransaction();
     }
 }