The official Laravel SDK for Sentry (sentry.io)
MIT License
Bot releases are visible (Hide)
Published by getsentry-bot 6 months ago
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.
Published by getsentry-bot 7 months ago
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.
Published by getsentry-bot 8 months ago
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',
],
Published by getsentry-bot 9 months ago
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)
Published by getsentry-bot 9 months ago
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)
Published by getsentry-bot 10 months ago
Published by getsentry-bot 11 months ago
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,
],
Published by getsentry-bot 11 months ago
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.Published by getsentry-bot about 1 year ago
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.Published by getsentry-bot about 1 year ago
The Sentry SDK team is happy to announce the immediate availability of Sentry Laravel SDK v3.7.2.
Published by getsentry-bot about 1 year ago
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.
Published by getsentry-bot about 1 year ago
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.
Published by getsentry-bot over 1 year ago
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.