Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sentry Symfony Laravel Package

sentry/sentry-symfony

The official Sentry SDK for Symfony. Install via Composer, add your SENTRY_DSN to .env, and capture exceptions from anywhere in your app. Get real-time error tracking and performance monitoring with minimal setup.

View on GitHub
Deep Wiki
Context7
5.14.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.14.0.

Features

  • Add the data_collection option to control which potentially sensitive data the SDK attaches to events and spans. (#1087)

    sentry:
        options:
            data_collection:
                user_info: true
                http_headers:
                    mode: allowList
                    terms:
                        - x-request-id
                http_bodies: []
                database_query_data: false
    

Bug fixes

  • Set the user context before the router runs, so that events for unmatched routes include the client IP address. (#1068)

Misc

  • Bump sentry-php version to 4.34.0. (#1087)
5.13.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.13.0.

Misc

  • Bump sentry-php version to 4.31.0. (#1053)
5.12.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.12.0.

Bug fixes

  • Start the runtime context before the router and security firewall to prevent logs and breadcrumbs from leaking across requests on persistent workers. (#1043)

Misc

  • Add support for guzzlehttp/psr7 3.x for Guzzle 8 compatibility. (#1046)
5.11.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.11.0.

Bug fixes

  • Escape values rendered by the Twig sentry_trace_meta() and sentry_baggage_meta() helpers. (#1025)
  • Clear the active request from RequestFetcher during kernel termination even when no transaction is set on the hub. (#1026)
  • Use Symfony's security.untracked_token_storage service in LoginListener. (#1028)
5.10.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.10.0.

Features

  • Add support for strict_trace_continuation and org_id to continue incoming traces only when they belong to the same Sentry organization. (#1002)
  • Add ConsoleInputSerializer to capture console command arguments and options via class_serializers. (#1007)
  • Add support for log_flush_threshold to flush logs once a configured batch size is reached. (#1012)
  • Add support for Sentry\Integration\OTLPIntegration. (#1014)
  • Add tracing.dbal.ignore_prepare_spans to suppress db.sql.prepare spans for prepared queries. (#1016)
  • Isolate runtime context between HTTP requests on persistent workers, and add messenger.isolate_context_by_message to prevent scope, logs, and metrics data from leaking across messages. (#997)

Bug fixes

  • Remove the deprecated traceparent header. (#1005)

Misc

  • Bump sentry-php version to 4.23.0. (#1012)
5.9.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.9.0.

Misc

  • Bump sentry-php version to 4.20.0. (#996)
5.8.3

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.8.3.

Bug fixes

  • Using caches with namespaces will no longer cause an error. (#986)
5.8.2

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.8.2.

Bug fixes

  • Move symfony/yaml to a non-dev dependency. (#983)
5.8.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.8.1.

Improvements

  • Add support for before_send_metric and enable_metrics. (#981)
5.8.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.8.0.

Features

  • Add support for Sentry metrics. #977
// 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());
5.7.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.7.0.

Features

  • Add support for Symfony 8. (#968)

Misc

  • Add never as valid option for max_request_body_size. (#966)
5.6.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.6.0.

Features

  • Remove upper limit for max_breadcrumbs option. (#953)
  • Allow passing string and enum Monolog level. (#959)
services:
  Sentry\SentryBundle\Monolog\LogsHandler:
    arguments:
      - 'info'
# or using PSR constants
services:
  Sentry\SentryBundle\Monolog\LogsHandler:
    arguments:
      - !php/const Psr\Log\LogLevel::INFO
// or via PHP config
$container->services()
    ->set(\Sentry\SentryBundle\Monolog\LogsHandler::class)
    ->args([\Monolog\Level::Info]);
5.5.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.5.0.

Features

  • Enable auto-instrumentation for the Symfony Cache Component (#942)
  • Add a new config flag to reset breadcrumbs between Symfony messages (#946)
sentry:
  messenger:
    isolate_breadcrumbs_by_message: true
  • Allow to pass in callbacks to configure SDK integrations (#947)
services:
    App\IntegrationCallback:
        factory: ['App\IntegrationCallback', 'factory']

sentry:
    options:
        integrations: 'App\IntegrationCallback'
5.4.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.4.1.

Bug Fixes

  • Support named arguments in BufferFlushPass. (#948)
5.4.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.4.0.

Features

  • Introduce Sentry Structured Logging support. (#940)
sentry:
  options:
    enable_logs: true

services:
  Sentry\SentryBundle\Monolog\LogsHandler:
    arguments:
      - !php/const Monolog\Logger::INFO

monolog:
  handlers:
    sentry_logs:
      type: service
      id: Sentry\SentryBundle\Monolog\LogsHandler

Bug Fixes

  • Add buffer flusher for sentry monolog handler. (#936)
5.3.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.3.0.

Bug Fixes

  • Fix exception thrown when invalid IP address was captured by the request listener (#931)
5.3.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.3.0.

Features

  • Implement NamespacedPoolInterface for TraceableCacheAdapterForV3 (#927)

Misc

  • Update minimum required version of sentry/sentry to ^4.14.1
  • Remove support for traceparent header (#928)
5.2.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.2.0.

Features

  • Allow to configure the logger via the sentry.yaml configuration file (#899)

    sentry:
      dsn: "%env(SENTRY_DSN)%"
      options:
          logger: "sentry.logger"
    
    services:
      sentry.logger:
        class: 'Sentry\Logger\DebugFileLogger'
        arguments:
            $filePath: '../../var/log/sentry.log'
    

Bug Fixes

  • Fixed updating the user context when a route is marked as stateless (#910)

Misc

  • Remove symfony/security-core and symfony/security-http as dependencies (#912)
5.1.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.1.0.

Features

  • The SDK was updated to support PHP 8.4 (#893)
  • Set the status for CLI command transactions based on the exit code (#891)

Bug Fixes

  • Fix including request data on transactions (#879)
5.0.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.0.1.

Bug Fixes

  • Add missing setCallbackWrapper method to TraceableCacheAdapterTrait (#841)
  • Fix detection of the symfony/http-client being installed (#858)
5.0.0

The Sentry SDK team is thrilled to announce the immediate availability of Sentry Symfony SDK v5.0.0.

Breaking Change

Please refer to the UPGRADE-5.0.md guide for a complete list of breaking changes.

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. Previously, both Symfony\Component\ErrorHandler\Error\FatalError and Symfony\Component\Debug\Exception\FatalErrorException were ignored by default. To continue ignoring these exceptions, make the following changes to the config file:

    // config/packages/sentry.yaml
    
    sentry:
      options:
        ignore_exceptions:
          - 'Symfony\Component\ErrorHandler\Error\FatalError'
          - 'Symfony\Component\Debug\Exception\FatalErrorException'
    

    This option performs an is_a check now, so you can also ignore more generic exceptions.

Features

  • Add support for Sentry Developer Metrics (#1619)

    use function Sentry\metrics;
    
    // Add 4 to a counter named hits
    metrics()->increment(key: 'hits', value: 4);
    
    // Add 25 to a distribution named response_time with unit milliseconds
    metrics()->distribution(key: 'response_time', value: 25, unit: MetricsUnit::millisecond());
    
    // Add 2 to gauge named parallel_requests, tagged with type: "a"
    metrics()->gauge(key: 'parallel_requests', value: 2, tags: ['type': 'a']);
    
    // Add a user's email to a set named users.sessions, tagged with role: "admin"
    metrics()->set('users.sessions', '[email protected]', null, ['role' => User::admin()]);
    

    Metrics are automatically sent to Sentry at the end of a request, hooking into Symfony's kernel.terminate event.

  • Add new fluent APIs (#1601)

    // Before
    $transactionContext = new TransactionContext();
    $transactionContext->setName('GET /example');
    $transactionContext->setOp('http.server');
    
    // After
    $transactionContext = (new TransactionContext())
        ->setName('GET /example');
        ->setOp('http.server');
    
  • 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)

    The SDK now ships with its own HTTP client based on cURL. A few new options were added.

    // config/packages/sentry.yaml
    
    sentry:
      options:
        - http_proxy_authentication: 'username:password' // user name and password to use for proxy authentication
        - http_ssl_verify_peer: false // default true, verify the peer's SSL certificate
        - http_compression: false // default true, http request body compression
    

    To use a different client, you may use the http_client option. To use a different transport, you may use the transport option. A custom transport must implement the TransportInterface. If you use the transport option, the http_client option has no effect.

Misc

  • The abandoned package php-http/message-factory was removed.
4.14.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.14.0.

Features

  • Add support for doctrine/dbal: ^4.0 (#811)

Bug Fixes

  • Fix overwritting DbalTracingPass (#808)
  • Use AbstractDriverMiddleware (#810)
4.13.2

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.13.2.

Bug Fixes

  • Fix detection of the installed version of symfony/http-client (#797)
4.13.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.13.1.

Bug Fixes

  • Fix the HTTP client decoration when no http_client service is registered (#792)
4.13.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.13.0.

Features

  • Add support for Symfony 7 (#761)

Bug Fixes

  • Fix the decoration of the HTTP client when tracing is enabled (#786)
4.12.0

Features

  • Add support for symfony/psr-http-message-bridge: ^6.4 (#750)
  • Report individual exceptions from DelayedMessageHandlingException (#760)
4.11.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.11.0.

Bug Fixes

  • Silence TokenInterface::isAuthenticated deprecation in LoginListener (#755)

Misc

  • Prefer the SENTRY_RELEASE environment variable over the package root version (#753)
4.10.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.10.0.

Features

  • Tracing without Performance (#742)

    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 ignore_exceptions and ignore_transactions options (#724)

Misc

  • Improve setting logged-in users on the scope (#720)
  • Move DB span tags to span data (#743)
  • Set the span status when tracing an HTTP client request (#748)
4.9.2

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.9.2.

Bug Fixes

  • We decided to revert two previous PRs that aimed to remove deprecation warnings during test runs (#736)

    • Revert: Add a new Doctrine DBAL tracing driver that does not implement the deprecated VersionAwarePlatformDriver (#723)
    • Revert: Fix a regression in TracingDriverForV32 by adding VersionAwarePlatformDriver::createDatabasePlatformForVersion (#731)

We are sorry for the inconvenience caused by these changes.

4.9.1

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.9.1.

Bug Fixes

  • Fix a regression in TracingDriverForV32 by adding VersionAwarePlatformDriver::createDatabasePlatformForVersion (#731)
4.9.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.9.0.

Features

  • Add a new Doctrine DBAL tracing driver that does not implement the deprecated VersionAwarePlatformDriver (#723)

    The driver is automatically picked if doctrine/dbal version 3.2.0 or higher is installed.

Bug Fixes

  • Fix config type of http_connect_timeoutand http_timeout options (#721)

Misc

  • Bump the underlying PHP SDK to version ^3.19 (#725)
4.8.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.8.0.

Features

  • Set cache keys as span descriptions (#677)

    To better identify the source of a cache operation, we now set the cache key as the description of cache op spans.

Bug Fixes

  • Add direct dependency for guzzlehttp/psr7 (#708)
  • Drop kernel.build_dir param below Symfony 5.2 (#711)
4.7.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.7.0.

Features

4.6.0

The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v4.6.0. This release contains a colorful bouquet of new features.

Features

  • Report exceptions to Sentry as unhandled by default (#674)

    All unhandled exceptions will now be marked as handled: false. You can query for such events on the issues list page, by searching for error.handled:false.

  • Exceptions from messages which will be retried are sent to Sentry as handled (#674)

    All unhandled exceptions happening on the message bus will now be unpacked and reported individually. The WorkerMessageFailedEvent::willRetry property is used to determine the handled value of the event sent to Sentry.

  • Add register_error_handler config option (#687)

    With this option, you can disable the global error and exception handlers of the base PHP SDK. If disabled, only events logged by Monolog will be sent to Sentry.

      sentry:
          dsn: '%env(SENTRY_DSN)%'
          register_error_listener: false
          register_error_handler: false
    
      monolog:
          handlers:
              sentry:
                  type: sentry
                  level: !php/const Monolog\Logger::ERROR
                  hub_id: Sentry\State\HubInterface
    
  • Add before_send_transaction (#691)

    Similar to before_send, you can now apply additional logic for transaction events. You can mutate the transaction event before it is sent to Sentry. If your callback returns null, the event is dropped.

      sentry:
          options:
              before_send_transaction: 'sentry.callback.before_send_transaction'
    
      services:
          sentry.callback.before_send_transaction:
              class: 'App\Service\Sentry'
              factory: [ '[@App](https://github.com/App)\Service\Sentry', 'getBeforeSendTransaction' ]
    
      <?php
    
      namespace App\Service;
    
      class Sentry
      {
          public function getBeforeSendTransaction(): callable
          {
              return function (\Sentry\Event $event): ?\Sentry\Event {
                  return $event;
              };
          }
      }
    
  • Use the _route attribute as the transaction name (#692)

    If you're using named routes, the SDK will default to use this attribute as the transaction name. With this change, you should be able to see a full list of your transactions on the performance page, instead of << unparameterized >>.

    You may need to update your starred transactions as well as your dashboards due to this change.

Bug Fixes

  • Sanatize HTTP client spans (#690)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings