Before_send callback implementation in Symfony 3.4 project


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.

    class: AppBundle\Service\Sentry
        - [beforeSend]

//Sentry service file
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.