sentry/sentry-laravel
Official Sentry SDK for Laravel. Automatically capture and report unhandled exceptions and performance data to Sentry, with seamless Laravel integration and configuration. Supports modern Laravel versions and includes tooling for monitoring errors in production.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.25.0.
OTLPIntegration. (#1122)SentryTracesSampleRate job middleware to control trace sampling for individual jobs. (#1114)withExceptions(..) callbacks for unhandled console exceptions. (#1125)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.23.0.
strict_trace_continuation support to only continue incoming traces when the upstream baggage org_id matches the SDK org ID. (#1106)4.22.0 (#1106)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.21.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.21.0.
sentry-trace and baggage headers (#1091)preg_quote for environment variables (#1093)4.21.0 (#1095)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.20.1.
symfony/psr-http-message-bridge dependency (#1076)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.20.0.
// Counter metric
\Sentry\trace_metrics()->count('test-counter', 10, ['my-attribute' => 'foo']);
// Gauge metric
\Sentry\trace_metrics()->gauge('test-gauge', 50.0, ['my-attribute' => 'foo'], \Sentry\Unit::millisecond());
// Distribution metric
\Sentry\trace_metrics()->distribution('test-distribution', 20.0, ['my-attribute' => 'foo'], \Sentry\Unit::kilobyte());
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.19.0.
Add Laravel Pennant feature flags (#1061)
The SDK will now automatically capture feature flags resolved using Laravel Pennant and attach them to events and spans.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.18.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.17.0.
Configuring the channel is no longer required. To enable logs for Sentry, the following environment variables need to be configured:
LOG_CHANNEL=stack
LOG_STACK=single,sentry_logs
SENTRY_ENABLE_LOGS=true
Sentry will use LOG_LEVEL to determine the minimum log level, but it's possible to overwrite it just for Sentry
using SENTRY_LOG_LEVEL.
LOG_LEVEL=info
SENTRY_LOG_LEVEL=warning
sentry.origin attribute to LogsHandler. (#1041)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.16.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.15.3.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.15.1.
4.14.1 (#1013)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.15.0.
Add support for Sentry Structured Logs (#1000)
To enable this feature, add the sentry_logs log channel in your config/logging.php configuration:
'channels' => [
...
'sentry_logs' => [
'driver' => 'sentry_logs',
'level' => env('LOG_LEVEL', 'info'),
],
...
],
Add SENTRY_ENABLE_LOGS=true to your .env file.
Use the Log facade to sent your logs to Sentry. To learn more, head over to the Laravel docs.
use Illuminate\Support\Facades\Log;
Log::channel('sentry_logs')->info('User {id} failed to login.', ['id' => $user->id]);
To learn more, head over to our docs.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.14.1.
Ensure there is a newline before writing env variables (#1002)
Fixed an issue where the php artisan sentry:publish command might not properly add newlines when writing environment variables to the .env file.
Fix tracing when using Laravel Octane (#997)
When using Laravel Octane, the SDK now correctly cleans up it's state after each request, ensuring that traces are correctly reported.
Add sentry prefix to publish group name (#992)
When running php artisan vendor:publish, the Sentry package exports are now prefixed with sentry, making it easier to distinguish from other packages.
Remove support for traceparent header (#994)
The W3C's traceparent header is no longer automatically picked up and emitted by the SDK to prevent non-Sentry SDKs from starting a trace that is unwanted.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.13.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.12.0.
Improve generation of slug for scheduled job cron monitoring (#977)
For scheduled jobs it's no longer needed to manually provide a slug to the ->sentryMonitor() call, it will be derived from the job class name.
Disable scheduled task tracing for backgrounded tasks (#975)
Backgrounded tasks show up a ~1ms transactions right now because we are effectively monitoring the time it takes to start the background process instead of the execution. We are working on a solution to this problem, but in the meantime, we are disabling the monitoring of backgrounded tasks (that was introduces in 4.11.0).
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.10.2.
php artisan sentry:test (#963)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.10.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.7.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.7.0.
Add support for Cache Insights Module (#914). To learn more about this module, visit https://docs.sentry.io/product/insights/caches/. This feature requires Laravel v11.11.0 or higher.
Cache tracing is enabled by default for new SDK installations. To enable this feature in your existing installation, update your config/sentry.php file with 'cache' => env('SENTRY_TRACE_CACHE_ENABLED', true), under 'tracing'.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.6.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.6.0.
Add support for the Queue Insights Module (#902). To learn more about this module, visit https://docs.sentry.io/product/performance/queue-monitoring/.
Queue tracing is enabled by default for new SDK installations. To enable this feature in your existing installation, update your config/sentry.php file with 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), or set SENTRY_TRACE_QUEUE_JOBS_ENABLED=true in your environment (#903).
Check if a span is sampled before creating child spans (#898)
Always register the console sentryMonitor() macro. This fixes the macro not being available when using Laravel Lumen (#900)
Avoid manipulating the config when resolving disks (#901)
SENTRY_SPOTLIGHT environment variable and not requiring a DSN to be set to use Spotlight (#892)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.5.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.5.0.
Limit when SQL query origins are being captured (#881)
We now only capture the origin of a SQL query when the query is slower than 100ms, configurable by the SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS environment variable.
Add tracing and breadcrumbs for Notifications (#852)
Add reporter for Model::preventAccessingMissingAttributes() (#824)
Make it easier to enable the debug logger (#880)
You can now enable the debug logger by adding the following to your config/sentry.php file:
'logger' => Sentry\Logger\DebugFileLogger::class, // This will log SDK logs to `storage_path('logs/sentry.log')`
Only use this in development and testing environments, as it can generate a lot of logs.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.4.1.
assertExists/assertMissing can throw on the FilesystemDecorator (#877)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.4.0.
Add support for Laravel 11 Context (#869)
If you are using Laravel 11 and the new "Context" capabilities we now automatically capture that context for you and it will be visible in Sentry. Read more about the feature in the Laravel documentation and how to use it.
How can I help you explore Laravel packages today?