Before_send callback implementation in Symfony 3.4 project

Hello,

I’m trying to configure Sentry to ignore specific event types in a 3.4 Symfony project.
I’m using the Symfony official Sentry package. I want to filter the events matching certain criteria in the before_send callback but have no idea how to correctly configure it in services.yaml file. This is what i have so far. I think i have made a mistake.

//services.yaml
 sentry.callback.before_send:
    class: AppBundle\Service\Sentry
    calls:
        - [beforeSend]

//Sentry service file
<?php
namespace AppBundle\Service;

use Sentry\Event;

class Sentry
{
    public function beforeSend(\Sentry\Event $event):? \Sentry\Event
    {
        return $event;
    }
}

Could anyone provide me with a complete example of how to correctly create and configure this before_send callback functionality in my project so that it uses it?

Did you manage to get this to work? I can’t find any information on how to configure this.

I have the same question and after google it I found a solution. Here you have a solution to configure the before send service: