UPDATE
Yes acc. to this it is sync
https://github.com/getsentry/sentry-laravel/discussions/691#discussioncomment-5858747
Workaround:
What if: in the exception handler you send response with message 'unexpected error', you cache the exception under
'sentry_exception_' . getmypid().
then in the laravel.com/docs/8.x/middleware#terminable-middleware you retrieve from cache the exception (if set) and you send it to sentry after the response has been sent. All in a try catch. if it throws only log the exception. In any case remove the exception from the cache.
Note: If the process dies due to memory or timeout the exception is not sent with this middleware. So, maybe the job solution from bellow is better.
Old answer:
Note: also the queue might not work but it is a decent tradeoff. You can log the error and then try to send ti to sentry.
Not if you use jobs for reporting the unhandled exception and for reporting the handled ones.
If you dispatch a job then you must handle infinite loops in case that job fails: https://docs.sentry.io/platforms/php/guides/laravel/usage see queue jobs.
If it uses curl_multi_init then yes the request will take as long as the slowest request. Either way it is synk, blocking the response until all paralel requests are sent and each received an answer(promise response).
EDIT:
There are 2 parts for sentry:
laravel specific package: https://docs.sentry.io/platforms/php/guides/laravel/
```bash
composer require sentry/sentry-laravel
```
Enable capturing unhandled exception to report to Sentry by making the following change to your `App/Exceptions/Handler.php`:
```php {filename:App/Exceptions/Handler.php}
public function register()
{
$this->reportable(function (Throwable $e) {
if (app()->bound('sentry')) {
app('sentry')->captureException($e);
}
});
}
Sdk (used by the above) https://docs.sentry.io/platforms/php/
To install the SDK you will need to be using [Composer]([https://getcomposer.org/)
in your project. To install it please see the [docs](https://getcomposer.org/download/).
This is our "core" SDK, meaning that all the important code regarding error handling lives here.
If you are happy with using the HTTP client we recommend install the SDK like: [`sentry/sdk`](https://github.com/getsentry/sentry-php-sdk)
```bash
composer require sentry/sdk
```
This package (`sentry/sentry`) is not tied to any specific library that sends HTTP messages. Instead,
it uses [Httplug](https://github.com/php-http/httplug) to let users choose whichever
PSR-7 implementation and HTTP client they want to use.
If you just want to get started quickly you should run the following command:
```bash
composer require sentry/sentry php-http/curl-client
```
This is basically what our metapackage (`sentry/sdk`) provides.
This will install the library itself along with an HTTP client adapter that uses
cURL as transport method (provided by Httplug). You do not have to use those
packages if you do not want to. The SDK does not care about which transport method
you want to use because it's an implementation detail of your application. You may
use any package that provides [`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
### Configuration
```php
\Sentry\init(['dsn' => '___PUBLIC_DSN___' ]);
```
### Usage
```php
try {
thisFunctionThrows(); // -> throw new \Exception('foo bar');
} catch (\Exception $exception) {
\Sentry\captureException($exception);
}
https://develop.sentry.dev/sdk/overview/:
The following items are expected of production-ready SDKs:
DSN configuration
**Graceful failures (e.g. Sentry server is unreachable)**
Setting attributes (e.g. tags and extra data)
Support for Linux, Windows and OS X (where applicable)
Feature based support is required for the following:
If cookie data is available, it’s not sent by default
If POST data is available, it’s not sent by default
Additionally, the following features are highly encouraged:
Automated error capturing (e.g. uncaught exception handlers)
Logging framework integration
**Non-blocking event submission**