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

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

Sentry for Symfony is the official SDK that connects your Symfony application to Sentry, delivering real-time error tracking, performance monitoring, and release health. Install it with Composer, add your DSN to .env, and the bundle automatically captures uncaught exceptions, console errors, and failed commands—no manual wiring required.

  • Automatic error capture for HTTP requests, console commands, and queue workers
  • Performance tracing via Symfony kernel and Doctrine instrumentation
  • Rich context with breadcrumbs from requests, logs, and user data
  • Profiling support to pinpoint slow code paths
  • Data scrubbing through configurable before_send hooks and PII controls
Frequently asked questions about Sentry Symfony
Can I use sentry/sentry-symfony in a Laravel application?
Not natively. sentry/sentry-symfony is the official Symfony bundle and expects Symfony's bundle registration, dependency injection, and event system. The underlying sentry/sentry package is framework-agnostic and can be used directly in Laravel. Only adopt the Symfony bundle if your Laravel app also uses Symfony components and you are prepared to bridge configuration and integrations manually.
How do I install sentry/sentry-symfony with Composer?
Install it with composer require sentry/sentry-symfony. Add your Sentry DSN to the SENTRY_DSN environment variable in your .env file. In Symfony, Flex usually enables the bundle automatically; otherwise register it in config/bundles.php. Laravel will not auto-discover it as a Laravel package, so expect manual wiring if you try it there.
How do I configure the Sentry DSN for sentry/sentry-symfony?
Set SENTRY_DSN in your .env file, for example SENTRY_DSN=https://[email protected]/1. In Symfony, you can also map options through the bundle's YAML configuration. For Laravel, the practical path is to map the same environment value into config/sentry.php and initialize the core sentry/sentry SDK yourself.
Does sentry/sentry-symfony support Laravel 10 and Laravel 11?
There is no native Laravel support in sentry/sentry-symfony because it targets Symfony. The underlying sentry/sentry SDK is framework-agnostic and can be wired into Laravel 10 or 11 through App\Exceptions\Handler or a custom reporting service. Symfony-specific features such as Doctrine and Messenger auto-instrumentation will not work out of the box in Laravel. For most Laravel 10 and 11 applications, a Laravel-specific Sentry SDK or sentry/sentry directly is the safer choice.
What features does sentry/sentry-symfony add beyond basic error tracking?
It supports exception capture, breadcrumbs, distributed tracing, structured logging, metrics, OTLP integration, and CLI command tracking. As a Symfony bundle, it also adds auto-instrumentation for Symfony HTTP, Doctrine, Messenger, Cache, and related components. In Laravel, many of those Symfony-specific integrations require manual implementation or must be disabled.
Should Laravel teams use sentry/sentry-symfony or sentry/sentry?
For a Laravel-centric application, use sentry/sentry directly or a Laravel-specific Sentry SDK rather than the Symfony bundle. Choose sentry/sentry-symfony only if your app genuinely uses Symfony components such as Messenger or Doctrine and you need the bundle's auto-instrumentation. This avoids unnecessary Symfony dependencies and keeps configuration aligned with Laravel conventions.
How do I capture exceptions in Laravel if I install sentry/sentry-symfony?
Use the underlying Sentry\captureException function from the sentry/sentry dependency inside App\Exceptions\Handler or your report method. Initialize the SDK with your DSN during application boot. Do not rely on the Symfony bundle's kernel exception listener to handle Laravel exceptions automatically. For queue jobs, wrap execution with Sentry\init or use a custom queue listener to isolate context.
How can I test Sentry error reporting in a Laravel app?
In Laravel tests, use the core sentry/sentry SDK with a null DSN or a mocked transport so real events are not sent. Assert that your exception handler or reporting service calls Sentry capture logic for expected exceptions. If you are testing the Symfony bundle itself, disable it in the test environment or use its test configuration options. This keeps test suites fast and prevents noisy Sentry projects.
What production risks should I consider with sentry/sentry-symfony?
Auto-instrumentation for cache, Doctrine, Messenger, and tracing adds runtime hooks and can introduce overhead, so enable optional integrations selectively. Version 5.0.0 requires envelope endpoint support and removed traceparent support, which is a blocker for self-hosted Sentry older than 20.6.0. The Symfony bundle can also pull in optional dependencies that are unnecessary in a Laravel app. Review sampling, integration flags, and dependency footprint before production rollout.
Is sentry/sentry-symfony actively maintained and what alternatives exist?
Yes, it is a first-party Sentry SDK with ongoing releases and upgrade guides, though major versions such as 5.0.0 can include breaking changes. For Laravel, the main alternatives are sentry/sentry directly, a Laravel-specific Sentry SDK, or another observability platform. Pin your Composer versions and review the Sentry upgrade notes before moving major versions.
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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style