Configure Sentry for PHP/Symfony to log events in a local file rather than sending them directly to Sentry

106 Views Asked by At

We are currently experiencing a performance issue with Sentry in PHP, which sends events in real-time through an API call. If the connection is slow or if, for some reason, the Sentry Server is unreachable, it significantly impacts the overall performance of the application.

Our preference is to log events locally and subsequently send them to Sentry using Fluentbit. Could someone provide an example of such a configuration?

1

There are 1 best solutions below

1
rhinosforhire On

Sentry is a real-time monitoring tool, and it sounds like you may not need it.

If you do need it, and slow connections happen randomly, try reducing Sentry's http_connect_timeout and http_timeout options so your servers don't wait long during network turbulence.

Sentry\init([
    'http_connect_timeout' => 2, // The default is two seconds.
    'http_timeout' => 5 // Reduce these values and test if Sentry still sends events.
]);