gcg-it/sentry-symfony
gcg-it/sentry-symfony integrates Sentry error tracking and performance monitoring into Symfony applications, offering automatic exception capture, request tracing, and configurable reporting through Symfony bundle and dependency injection setup to help teams diagnose production issues quickly.
Read this first: this bundle will not run under Laravel. gcg-it/sentry-symfony registers SentryBundle\SentryBundle, hooks Symfony's KernelEvents (kernel.request, kernel.exception, kernel.terminate) via compiler passes, and expects the Symfony HTTP kernel lifecycle. Laravel bootstraps its own kernel and dispatcher; none of those listeners fire. There is no service provider, no facade, no middleware, no publishable config. For a Laravel team, the day-one task is deciding not to put this in the tree.
The correct dependency is sentry/sentry-laravel. If you are on a hybrid estate with a legacy Symfony service alongside Laravel apps, the Symfony service gets the official sentry/sentry-symfony — not this fork — and Laravel gets sentry/sentry-laravel. Both talk to the same Sentry project if you keep environment, release, and traces_sample_rate conventions aligned.
If you are nonetheless opening this repo (auditing a transitive dep, or inheriting a Symfony service someone else built), the minimum steps are:
composer.json and the tag/branch history against sentry/sentry-symfony. With 0 stars and 0 dependents this is almost certainly an agency fork carrying a patch (older Symfony LTS, a custom transport, a before_send tweak). You need to know what is patched before you can justify it.composer require gcg-it/sentry-symfony --dry-run, then composer why-not laravel/framework. Laravel pins symfony/* transitives per major; this bundle's constraints may collide and block a future framework upgrade.SentryBundle\SentryBundle::class => ['all' => true] in config/bundles.php and create config/packages/sentry.yaml:sentry:
dsn: '%env(SENTRY_DSN)%'
options:
environment: '%kernel.environment%'
release: '%env(SENTRY_RELEASE)%'
traces_sample_rate: 0.1
send_default_pii: false
environment/release. Then delete the route. Do the exact same smoke test with sentry/sentry-laravel on your Laravel app so you have a baseline.Where to look first in the source: DependencyInjection/Configuration.php (the real config surface — usually richer than the README), EventListener/ (what is auto-hooked), and Resources/config/ (service wiring).
The bundle's own pattern (Symfony only, for context when you read the code): an exception listener catches uncaught exceptions at the kernel boundary and reports them; a Monolog handler forwards warnings and above as events; the Hub is available as a service for manual capture. Day-to-day, developers rarely touch the bundle — they write normal Symfony code and errors show up on their own.
The Laravel equivalent you will actually write — one-to-one with the Symfony surface:
| Symfony (this bundle) | Laravel (sentry/sentry-laravel) |
|---|---|
kernel.exception listener |
Exception handler hook (automatic) |
Monolog handler in monolog.yaml |
Sentry\Monolog\Handler via logging.php channels |
Hub as DI service |
Sentry\State\HubInterface from the container / SentrySdk::getCurrentHub() |
sentry.yaml bundle config |
config/sentry.php + SENTRY_LARAVEL_DSN |
Day-to-day patterns you'll reach for (identical in both SDKs, so skills transfer):
\Sentry\configureScope(function (\Sentry\State\Scope $scope) use ($user): void {
$scope->setUser(['id' => $user->id, 'email' => $user->email]);
});
\Sentry\setTag('tenant', $tenant->id) and \Sentry\addBreadcrumb(...) around integrations.SENTRY_RELEASE (or SENTRY_LARAVEL_DSN/SENTRY_RELEASE in Laravel) to the git SHA in your deploy pipeline. Without this, regressions can't be pinned to a deploy.sentry/sentry-laravel instruments queue workers and the console kernel. If job failures matter to you (they do), this is a large part of the value.try/catch that logs-and-continues should \Sentry\captureException($e) first, so the error doesn't vanish from the dashboard.Hybrid estate workflow: treat the two SDKs as separate dependencies per app, sharing only environment conventions. Do not try to make one package cover both frameworks — that is how teams end up with an observability dependency that silently no-ops on one side.
send_default_pii: false and add a before_send scrubber for anything sensitive (auth headers, tokens, email fields).before_send filter or a "Sentry internal error" allowlist.Hub/Scope APIs and configuration keys changed. Before pinning this fork, confirm which SDK major it targets and that it matches what sentry/sentry-laravel or a Symfony LTS pins — you don't want the two halves of a hybrid estate on different SDK majors if you ever share a project or a runbook.laravel/framework pins symfony/* transtively per major. Installing this bundle can resolve today and then block a framework upgrade next quarter with a confusing why-not. Check upfront and record the constraint in the dependency register.traces_sample_rate, verbose breadcrumbs, or logging at debug through the Monolog handler will burn plan units fast. Sample tracing at 5–10% and be deliberate about which log levels become events.options map, not custom container services. Anything exotic (custom transport, event processors, before_send, integrations) is done by configuring options or by adding a service tagged as a Sentry event processor / breadcrumb builder — check the bundle's Resources/config/ for the exact service IDs and tags rather than guessing.composer why gcg-it/sentry-symfony and remove it. A Symfony-only fork has no defensible place in a Laravel dependency graph, and the correct replacement (sentry/sentry-laravel) is a first-party package with a release cadence, upstream security backports, and a support path.How can I help you explore Laravel packages today?