NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #229 most downloaded on Packagist
Laravel SDK for Sentry (https://sentry.io)
Latest stable
4.31.0
Last release 3 days ago
19 Nov 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
151 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Please refer to the UPGRADE-5.0.md guide for a complete list of breaking changes and how to migrate. Upgrading with an AI coding agent? Use this promp…
The Sentry SDK team is happy to announce the first beta release of Sentry Laravel SDK v5.0.0.
This is a pre-release of the next major version. The API can still change before the stable release, so we do not recommend it for production yet. To try it out, install the beta explicitly. The PHP SDK has to be listed as well, because Composer does not install pre-releases of a dependency on its own:
composer require "sentry/sentry-laravel:^5.0@beta" "sentry/sentry:^5.0@beta"Please refer to the UPGRADE-5.0.md guide for a complete list of breaking changes and how to migrate.
Upgrading with an AI coding agent? Use this prompt.Upgrade this project from version 4 to version 5 of the Sentry Laravel SDK (sentry/sentry-laravel).
1. Run `composer require "sentry/sentry-laravel:^5.0@beta" "sentry/sentry:^5.0@beta"`.
2. Read vendor/sentry/sentry-laravel/UPGRADE-5.0.md completely. It is the source of truth for every
breaking change. If the project also uses the PHP SDK directly (the Sentry\ namespace or the
\Sentry\...() helper functions), read vendor/sentry/sentry/UPGRADE-5.0.md as well. Version 5 is
newer than what you know about these SDKs, so do not rely on your memory of their API. When the
guides do not cover something, read the code in vendor/sentry/sentry-laravel/src and
vendor/sentry/sentry/src instead of guessing.
3. Search the whole project for usages of the SDK: config/sentry.php, the SENTRY_* variables in the
.env files, bootstrap/app.php and the exception handler, the `sentry` and `sentry_logs` log
channels in config/logging.php, the Sentry facade, app('sentry'), type-hints on
Sentry\State\HubInterface, everything from the Sentry\ namespace, and classes that extend SDK
types such as the SentryHandler.
4. Apply the changes from the guides to every usage you found.
5. Run the static analysis and the tests of the project, if it has them, and fix what the upgrade
broke.
Some changes do not cause an error, so nothing will point you to them. Check each of these explicitly:
- Removed options are ignored silently. Compare every option in config/sentry.php with the guide. If
the project has no published config file, check the SENTRY_* environment variables instead.
- The send_default_pii option is gone, and the defaults of the data_collection option collect more
data than before, whichever value send_default_pii had. What gets collected is a privacy decision
that is mine to make: apply the restrictive configuration from the guide, which is the closest to
the old behavior, and list what I could enable on top of it. This only applies if data_collection
is missing from config/sentry.php or set to null, which is what a config file published with
version 4 contains. If the project already configures data_collection, send_default_pii was
already ignored and the existing data_collection configuration keeps applying, so only remove
send_default_pii.
- The breadcrumbs.sql_bindings and tracing.sql_bindings options are gone. A config file that was
published before no longer reads SENTRY_TRACE_SQL_BINDINGS_ENABLED until data_collection is added
to it. If the project already configures data_collection, these options were already ignored, so
only remove them.
- The max_request_body_size value none is no longer valid and falls back to medium, which collects
request bodies. Replace it with never.
- The client is never null anymore. Remove the null checks, and tell me where one of them was used
to detect that the SDK is not configured.
- Jobs that run synchronously no longer get a scope of their own. Tell me where a job sets tags, the
user or other scope data and can run with the sync driver or dispatchSync().
- The enable_logs option is gone, so the sentry_logs log channel sends logs whenever it is used.
Tell me if the project relied on SENTRY_ENABLE_LOGS to turn it off in some environments.
When you are done, give me a summary of what you changed and a separate list of what I have to
decide or check myself. Include the changes that affect what shows up in Sentry: transactions with
a 404 status are no longer sent, error events can get a different transaction name, logs carry a
span_id instead of the sentry.trace.parent_span_id attribute, and the events of failed queue jobs
and of sync jobs carry different scope data.
Require version 5 of the PHP SDK. Its Hub has been removed, so Sentry\State\HubInterface is no longer bound in the container. app('sentry'), the Sentry facade and type-hints now resolve the new Sentry\Laravel\Sentry class, which keeps the methods of the Hub. (#1219)
// Before
public function __construct(\Sentry\State\HubInterface $sentry) {}
// After
public function __construct(\Sentry\Laravel\Sentry $sentry) {}getClient() never returns null. When Sentry is not configured it returns a Sentry\NoOpClient. (#1219)
The callbacks of configureScope(), withScope() and Integration::configureScope() receive a Sentry\State\IsolationScope instead of a Sentry\State\Scope. The \Sentry\withScope() function has been removed from the PHP SDK, use \Sentry\withIsolationScope() or withScope() on the Sentry facade instead. (#1219)
The SentryHandler constructor takes a Sentry\Laravel\Sentry instead of a HubInterface, and its $hub property has been renamed to $sentry. (#1219)
The scope of a queue job that threw is popped once the worker has reported the exception, instead of when the next job starts. Jobs that run synchronously no longer get a scope of their own and run in the scope that dispatched them. (#1219)
The send_default_pii option has been removed. The data_collection option now always decides which data the SDK collects, and its defaults collect more data than send_default_pii did. (#1241)
If you already configure data_collection, it keeps applying as before and you only have to remove send_default_pii from your config. Otherwise, including when data_collection is null, restrict the collection to roughly what send_default_pii => false collected before with:
// config/sentry.php
'data_collection' => [
'user_info' => false,
'cookies' => ['mode' => 'off'],
'http_bodies' => ['incomingRequest'],
'gen_ai' => ['inputs' => false, 'outputs' => false],
'database_query_data' => false,
'queues' => false,
],The breadcrumbs.sql_bindings and tracing.sql_bindings options have been removed. Use data_collection.database_query_data instead, which also covers the parameters of Redis commands. They were already ignored when data_collection was configured. (#1241)
sentry:publish no longer asks whether to send default PII, and its --with-send-default-pii option has been removed. (#1241)
The trace_ignore_status_codes option now defaults to [404], so transactions of requests that end in a 404 response are no longer sent, including those of matched routes.
The options that the PHP SDK removed are no longer available in config/sentry.php, such as enable_tracing, spotlight_url, enable_logs, enable_metrics, context_lines, max_value_length and strict_trace_propagation. Logs and metrics are always sent when their APIs or the sentry_logs log channel are used.
The deprecated Integration::sentryW3CTracingMeta(), BaseServiceProvider::couldHavePerformanceTracingEnabled() and Feature::shouldSendDefaultPii() methods have been removed. (#1219), (#1241)
Add getGlobalScope(), getIsolationScope() and withIsolationScope() to the Sentry facade and app('sentry'). Data on the global scope is applied to every event of the process and survives across requests and jobs in long-running workers, while the isolation scope holds the data of the current request, command or job. (#1219)
use Sentry\Laravel\Facade as Sentry;
// Applied to every event of this worker process
Sentry::getGlobalScope()->setTag('worker', 'queue-1');
// Applied to the events of the current request, command or job
Sentry::getIsolationScope()->setTag('feature', 'checkout');QueryExecuted listener when the breadcrumbs.sql_queries and tracing.sql_queries options are both disabled. (#1240)SplObjectStorage deprecation warnings on PHP 8.5 when scheduled tasks are monitored. (#1242)Your coding agent can read these notes before it upgrades. Set up the MCP server →
Avoid PHP 8.5 deprecation warnings for SplObjectStorage::attach() and SplObjectStorage::contains() when monitoring scheduled tasks.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.31.0.
SplObjectStorage::attach() and SplObjectStorage::contains() when monitoring scheduled tasks. (#1242)QueryExecuted events when breadcrumbs.sql_queries or tracing.sql_queries is disabled, so database drivers that only do extra work when the event has a listener, such as mongodb/laravel-mongodb, no longer pay for it. (#1240)view.render spans only once per view factory, so composers no longer pile up and run on every render when view engines are resolved again, for example on Laravel Octane. (#1236)4.38.0The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.30.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.30.0.
Add the crons.monitor_scheduled_tasks config option to monitor every scheduled task without adding ->sentryMonitor() to each one. (#1202)
The schedule of each task is sent along with its check-ins, so Sentry creates the monitors and keeps them in sync. Use crons.exclude_scheduled_tasks to skip tasks by command, job class, task name or monitor slug, with * as a wildcard.
// config/sentry.php
'crons' => [
'monitor_scheduled_tasks' => env('SENTRY_CRONS_MONITOR_SCHEDULED_TASKS', false),
'exclude_scheduled_tasks' => ['horizon:snapshot', 'scheduled_reports-*'],
],Tasks with ->sentryMonitor() keep their own settings. Closures without a name(), sub-minute tasks, tasks that can skip runs (when, skip, between), tasks without a named timezone in a non-UTC app and tasks whose schedule Sentry would read differently are not monitored automatically.
Ignore Laravel Horizon, Laravel Telescope and Laravel Debugbar transactions by default. (#1223)
This only applies if you have not published the config file. To ignore them with a published config, add the pattern to ignore_transactions:
// config/sentry.php
'ignore_transactions' => [
'/up',
'/^\/(horizon|telescope|_debugbar)(\/|$)/',
],Shorten the description of view.render spans for views rendered from a file, such as Laravel Folio pages, by removing the application base path. (#1228)
app.bootstrap span with a negative duration, which could happen on Laravel Octane or when a route used Artisan::call. (#1221)cache.ttl and session.ttl span attributes when an entry never expires instead of sending null. (#1205)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.29.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.29.0.
Add the data_collection config option to control which data is collected automatically. (#1179)
When data_collection is null (the default), data collection keeps following send_default_pii.
// config/sentry.php
'data_collection' => [
'user_info' => false,
'http_bodies' => ['incomingRequest', 'outgoingRequest'],
'database_query_data' => false,
'gen_ai' => [
'inputs' => false,
'outputs' => true,
],
],When data_collection is set, the breadcrumbs.sql_bindings and tracing.sql_bindings options are ignored.
Show the data collection status in php artisan about. (#1198)
Add the origin of slow HTTP client requests to their spans. Configure this with the tracing.http_client_requests_origin and tracing.http_client_requests_origin_threshold_ms options (default: 250). (#1066)
Add gen_ai.evaluate spans for laravel/ai 1.0 classifications. Configure this with the tracing.gen_ai_evaluate option. (#1181), (#1182), (#1199)
Add Integration::setConversationId() to set the gen AI conversation ID for integrations that do not provide it, such as classifications, or for AI calls proxied across multiple requests. (#1193)
session.* spans and breadcrumbs instead of cache.*. (#1129)laravel/ai agent invocations so later requests do not inherit them. (#1160)4.34.0The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.28.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.28.0.
laravel/ai 1.0 when tracing agents and embeddings. (#1165)4.31.0 (#1155)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.27.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.27.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.26.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.26.0.
sentryMonitor. (#1136)sql_bindings default values. (#1135)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.25.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.25.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.25.0.
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.24.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.23.0.
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.22.0.
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.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.21.0.
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.
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.
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.
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.18.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.17.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.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.3.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.15.2.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.15.1.
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.
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.
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
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.14.0.
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.13.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.12.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.11.0.
Fixed a PHP 8.4 deprecation notice when running php artisan sentry:test
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.10.2.
php artisan sentry:test (#963)Fixed a PHP 8.4 deprecation notice
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.10.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.9.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.8.0.
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.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.7.0.
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.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.6.0.
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.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.5.0.
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.
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.
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.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.3.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.3.1.
FilesystemDecorator (#865)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.3.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.3.0.
Add support for Laravel 11.0 (#845)
If you're upgrading an existing Laravel 10 application to the new Laravel 11 directory structure, you must change how Sentry integrates into the exception handler. Update your bootstrap/app.php with:
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Sentry\Laravel\Integration;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
Integration::handles($exceptions);
})->create();
If you plan to perform up-time checks against the new Laravel 11 /up health URL, ignore this transaction in your config/sentry.php file, as not doing so could consume a substantial amount of your performance unit quota.
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-transactions
'ignore_transactions' => [
// Ignore Laravel's default health URL
'/up',
],
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.2.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.2.0.
Add new spans, measuring the time taken to queue a job (#833)
Add support for failure_issue_threshold & recovery_threshold for sentryMonitor() method on scheduled commands (#838)
Automatically flush metrics when the application terminates (#841)
Add support for the W3C traceparent header (#834)
Improve php artisan sentry:test to show internal log messages by default (#842)
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.1.2.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.1.2.
Fix unable to set callable for integrations option (#826)
Fix performance traces not being collected for Laravel Lumen unless missing routes are reported (#822)
Fix configuration options for queue job tracing not applying correctly (#820)
symfony/psr-http-message-bridge dependency (#829)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.1.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.1.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v4.1.0.
Capture SQL query bindings (parameters) in SQL query spans (#804)
To enable this feature, update your config/sentry.php file or set the SENTRY_TRACE_SQL_BINDINGS_ENABLED environment variable to true.
'tracing' => [
'sql_bindings' => true,
],
Please refer to the PHP SDK sentry-php/UPGRADE-4.0.md guide for a complete list of breaking changes.
The Sentry SDK team is thrilled to announce the immediate availability of Sentry Laravel SDK v4.0.0.
This version adds support for the underlying Sentry PHP SDK v4.0. Please refer to the PHP SDK sentry-php/UPGRADE-4.0.md guide for a complete list of breaking changes.
This version exclusively uses the envelope endpoint to send event data to Sentry.
If you are using sentry.io, no action is needed.
If you are using an on-premise/self-hosted installation of Sentry, the minimum requirement is now version >= v20.6.0.
You need to have ext-curl installed to use the SDK.
The IgnoreErrorsIntegration integration was removed. Use the ignore_exceptions option instead.
// config/sentry.php
'ignore_exceptions' => [BadThingsHappenedException::class],
This option performs an is_a check now, so you can also ignore more generic exceptions.
Enable distributed tracing for outgoing HTTP client requests (#797)
This feature is only available on Laravel >= 10.14.
When making a request using the Laravel Http facade, we automatically attach the sentry-trace and baggage headers.
This behaviour can be controlled by setting trace_propagation_targets in your config/sentry.php file.
// config/sentry.php
// All requests will contain the tracing headers. This is the default behaviour.
'trace_propagation_targets' => null,
// To turn this feature off completely, set the option to an empty array.
'trace_propagation_targets' => [],
// To only attach these headers to some requests, you can allow-list certain hosts.
'trace_propagation_targets' => [
'examlpe.com',
'api.examlpe.com',
],
Please make sure to remove any custom code that injected these headers previously.
If you are using the Sentry\Tracing\GuzzleTracingMiddleware provided by our underlying PHP SDK, you must also remove it.
Add support for Laravel Livewire 3 (#798)
The SDK now creates traces and breadcrumbs for Livewire 3 as well. Both the class-based and Volt usage are supported.
// config/sentry.php
'breadcrumbs' => [
// Capture Livewire components in breadcrumbs
'livewire' => true,
],
'tracing' => [
// Capture Livewire components as spans
'livewire' => true,
],
Add new fluent APIs (#1601)
// Before
$spanContext = new SpanContext();
$spanContext->setDescription('myFunction');
$spanContext->setOp('function');
// After
$spanContext = (new SpanContext())
->setDescription('myFunction');
->setOp('function');
Simplify the breadcrumb API (#1603)
// Before
\Sentry\addBreadcrumb(
new \Sentry\Breadcrumb(
\Sentry\Breadcrumb::LEVEL_INFO,
\Sentry\Breadcrumb::TYPE_DEFAULT,
'auth', // category
'User authenticated', // message (optional)
['user_id' => $userId] // data (optional)
)
);
// After
\Sentry\addBreadcrumb(
category: 'auth',
message: 'User authenticated', // optional
metadata: ['user_id' => $userId], // optional
level: Breadcrumb::LEVEL_INFO, // set by default
type: Breadcrumb::TYPE_DEFAULT, // set by default
);
New default cURL HTTP client (#1589)
php-http/message-factory was removed.The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.8.2.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.8.2.
DateTimeZone not properly converted to a string when using Cron Monitoring (#783)Fix a deprecation notice caused by passing null to Str::startsWith()
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.8.1.
null to Str::startsWith() (#780)The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.8.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.8.0.
Initial support for Laravel Folio (#738)
If you are using Laravel Folio in your application, we'll extract a more meaningful transaction name based on the
VieMatched event.
The filesystem adapters for the sentry driver now extend the well-known Laravel classes they decorate,
Illuminate\Filesystem\FilesystemAdapter and Illuminate\Filesystem\AwsS3V3Adapter.
Enabling the feature can be simplified by wrapping the configuration for all disks
with a call to Sentry\Laravel\Features\Storage\Integration::configureDisks()
in your config/filesystems.php file:
'disks' => Sentry\Laravel\Features\Storage\Integration::configureDisks([
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
// ...
], /* enableSpans: */ true, /* enableBreadcrumbs: */ true),
Alternatively, you can enable this feature only for select disks:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
's3' => Sentry\Laravel\Features\Storage\Integration::configureDisk('s3', [
// ...
], /* enableSpans: */ true, /* enableBreadcrumbs: */ true),
],
By default, both spans and breadcrumbs are enabled.
You may disable them by passing the second argument, $enableSpans or the third argument, $enableBreadcrumbs.
Add Laravel artisan about command (#768)
Remove usage of Str::replace (#762)
Differentiate between boot and register for features (#759)
Internal improvements (#769)
@define-env annotation.@internal and make it lazy for the tracing service provider.The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.3.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.3.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.2.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.2.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.1.
Performance traces and breadcrumbs for filesystem access are now turned off by default (#746)
To enable the feature, you'll need to make some changes in your config/filesystems.php file for each disk where you want to enable the tracing filesystem driver.
// For example, if you want to trace the `local` disk, you update the disk config from this:
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
// to this:
'local' => [
'driver' => 'sentry',
'root' => storage_path('app'),
'throw' => false,
'sentry_disk_name' => 'local',
'sentry_original_driver' => 'local',
'sentry_enable_spans' => true,
'sentry_enable_breadcrumbs' => true,
],
For each disk, you replace the driver key with sentry and add the sentry_original_driver key with the original driver name.
For us to construct the original driver, you also need to add the sentry_disk_name key with the name of the disk.
In addition, you can specify the optional sentry_enable_spans and sentry_enable_breadcrumbs config keys to turn off that feature for the disk.
These options are enabled by default.
Please note that we replace the driver for the disk with a custom driver that will capture performance traces and breadcrumbs.
This means that relying on the disk to be of a specific type might cause problems.
If you rely on the disk being an instance of Illuminate\Contracts\Filesystem\Filesystem or Illuminate\Contracts\Filesystem\Cloud, there should be no problem.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.0.
Tracing without Performance (#719)
The SDK will now continue a trace from incoming HTTP requests, even if performance is not enabled.
To continue a trace outward, you may attach the Sentry tracing headers to any HTTP client request.
You can fetch the required header values by calling \Sentry\getBaggage() and \Sentry\getTraceparent().
Add performance traces and breadcrumbs for filesystem access (#726)
This behaviour can be changed in your config/sentry.php file.
'breadcrumbs' => [
// Capture storage access as breadcrumbs
'storage' => true,
],
`tracing` => [
// Capture storage access as spans
'storage' => true,
],
GraphQL and HTTP client improvements (#720)
This adds an improved visual representation of the request body on the Sentry web interface, as well as
response_body_size and request_body_size to HTTP client breadcrumbs.
Less sensitive data send by default (#732)
The SDK will no longer send the value of the configured Laravel session cookie as well as the value of any cookies
starting with remember_*.
Additionally, SQL bindings are no longer set on breadcrumbs by default. This behaviour can be changed in your config/sentry.php file.
'breadcrumbs' => [
// Capture bindings on SQL queries logged in breadcrumbs
'sql_bindings' => false,
],
Make it configurable if performance traces continue after the response has been sent (#727)
This behaviour can be changed in your config/sentry.php file.
'tracing' => [
// Indicates if the performance trace should continue after the response has been sent to the user until the application terminates
// This is required to capture any spans that are created after the response has been sent like queue jobs dispatched using `dispatch(...)->afterResponse()` for example
'continue_after_response' => true,
],
Expose all config settings as environment variables. (#735)
All config values in config/sentry.php can be set with environment variables now.
For existing applications, you might need to update your config file with the new defaults manually.
The latest version can be found here.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.6.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.6.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.6.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.6.0.
Add support for upserting Cron Monitors (#677)
We simplified setting up monitoring for your scheduled tasks. Now, the only requirement is to add the
sentryMonitor macro. A corresponding monitor will be created automatically on Sentry.
protected function schedule(Schedule $schedule)
{
$schedule->command('emails:send')
->everyHour()
->sentryMonitor(); // add this line
}
You can read more about this in our docs.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.5.1.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.5.1.
Prevent registering terminating callback multiple times and guard against finishing already finished transactions (#717)
This fixes the Call to a member function finish() on null that could occur when using long running processes like on the CLI or with Laravel Octane.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.5.0.
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.5.0.
Improve terminating callbacks visibility (#707)
This adds support for performance traces that happen after the terminable middleware emits the response.
Add http.route.response span (#708)
Note: This feature requires Laravel
>= 10.13.0to hail any new spans.
This will add a http.route.response span which identifies possible actions taken to prepare the response, especially when using Illuminate\Contracts\Support\Responsable classes.
Refactor queue integration (#692)
This improves and fixes some edge cases around scope management when running Laravel Queues.
Improve lazyLoadingViolationReporter helper (#709)
Check for $model->exists and $model->wasRecentlyCreated before capturing the event.
^3.19 to enforce an upgrade to fix an issue in libcurl >= v8.1.0 (#711)One column per quarter.