Hi, tried to set this up for Symfony5 and I have problem with these 2 methods from MetricsGeneratorInterface
// called on the `kernel.request` event
public function collectRequest(GetResponseEvent $event): void
{
$request = $event->getRequest();
$requestMethod = $request->getMethod();
$requestRoute = $request->attributes->get('_route');
// do not track "OPTIONS" requests
if ('OPTIONS' === $requestMethod) {
return;
}
$this->incRequestsTotal($requestMethod, $requestRoute);
}
// called on the `kernel.terminate` event
public function collectResponse(PostResponseEvent $event): void
{
$response = $event->getResponse();
$request = $event->getRequest();
$requestMethod = $request->getMethod();
$requestRoute = $request->attributes->get('_route');
$this->incResponsesTotal($requestMethod, $requestRoute);
}
GetResponseEvent is renamed to RequestEvent
PostResponseEvent is renamed to TerminateEvent
Hi, tried to set this up for Symfony5 and I have problem with these 2 methods from MetricsGeneratorInterface
GetResponseEvent is renamed to RequestEvent PostResponseEvent is renamed to TerminateEvent
So it throws an exception.
Reference to docs about changes - https://symfony.com/blog/new-in-symfony-4-3-simpler-event-dispatching