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

Product Decisions This Supports

  • Error Monitoring & Debugging: Enable real-time error tracking, stack traces, and performance monitoring for Symfony applications, reducing MTTR for production issues.
  • Observability Roadmap: Integrate structured logging, metrics, and distributed tracing (via OTLP) to align with modern observability stacks such as Sentry’s Performance Monitoring.
  • Build vs. Buy: Avoid reinventing error tracking infrastructure; leverage Sentry’s mature ecosystem—breadcrumbs, release tracking, user context, and now configurable data collection—instead of custom solutions.
  • Privacy & Compliance Governance: With data_collection controls, product and engineering can decide which sensitive event/span data is attached—user info, HTTP headers via allowList, HTTP bodies, and database query data—supporting data-minimization policies and reducing third-party data exposure risk.
  • Use Cases:
    • Production Stability: Capture uncaught exceptions, fatal errors, and edge cases such as CLI commands and background jobs.
    • Performance Insights: Track transaction durations, database queries, and HTTP requests with auto-instrumentation.
    • User Debugging: Correlate errors with user sessions via Symfony’s security context, including unmatched-route events with client IP context in 5.14.0+.
    • Release Health: Monitor deployments with release tracking and performance comparisons.
    • Regulated or Privacy-Sensitive Environments: Adopt with explicit data_collection settings to limit PII, headers, request bodies, and query data sent to Sentry.

When to Consider This Package

  • Adopt if:

    • Your Symfony app (v4.4+) needs proactive error monitoring with minimal setup (DSN + config).
    • You require distributed tracing (e.g., microservices, async workers) or structured logging (Monolog integration).
    • Your team lacks dedicated SRE resources but needs actionable insights such as error rates and latency percentiles.
    • You’re using Sentry.io (cloud) or self-hosted Sentry ≥20.6.0 with envelope endpoint support.
    • You prioritize developer experience, including CLI command tracking and console argument serialization.
    • You need granular control over sensitive data sent to Sentry. In 5.14.0+, use data_collection to disable user info, allowList specific headers, exclude HTTP bodies, or disable database query data.
    • You want improved debugging for unmatched routes; 5.14.0 sets user context before routing so these events can include the client IP address.
  • Look elsewhere if:

    • You’re not using Symfony; this SDK is framework-specific.
    • Your stack requires OpenTelemetry-native tools such as Jaeger or Zipkin without Sentry’s UI.
    • You need low-level PHP error handling such as a custom set_error_handler; use sentry/sentry directly.
    • Your compliance policies prohibit sending any error data to a third-party processor. The new data_collection option improves minimization and redaction, but it does not remove the need for vendor/security review.
    • You’re on PHP <7.2 or Symfony <4.4 (unsupported versions).

How to Pitch It (Stakeholders)

For Executives: "This package integrates Sentry’s error monitoring into our Symfony app with minimal code changes for basic setup. It turns critical failures into actionable alerts, reducing downtime by surfacing issues like slow API calls or background job crashes automatically. The 5.14.0 release also adds configurable data_collection, so we can control whether user info, HTTP headers, request bodies, and database query data are attached to events. That means we get production visibility without abandoning privacy and compliance guardrails. If a payment processor fails, we can see the error, user context, and transaction trace in Sentry while limiting sensitive payloads—cutting debugging time without creating a data-governance blind spot."

For Engineering: *"The sentry/sentry-symfony bundle gives us:

  • Auto-instrumentation: Tracks HTTP requests, DB queries, and CLI commands out of the box, with no manual captureException calls needed for many cases.
  • Modern observability: Supports structured logs, metrics (counters/gauges), and distributed tracing via a single DSN.
  • Symfony-native integration: Works with Messenger, Doctrine, and Twig; configure via sentry.yaml and .env.
  • Privacy controls: 5.14.0 adds data_collection for user info, HTTP headers with allowList terms, HTTP bodies, and database query data—so we can tune payloads per environment and compliance requirement.
  • Routing fix: User context is now set before the router runs, improving client IP capture for unmatched-route events.
  • Performance: Batch processing and configurable flush thresholds minimize overhead. Tradeoff: Requires Sentry.io or self-hosted Sentry ≥20.6.0, but the ROI is clear—less fire-drill debugging, better data governance, and data-driven optimization."*

For DevOps/SRE: *"This simplifies incident response by:

  • Correlating errors with releases, e.g. “This crash started after v1.2.0.”
  • Isolating context in async workers (Messenger) to prevent data leakage.
  • Reducing alert noise with configurable ignore rules, e.g. skip FatalError.
  • Minimizing sensitive payloads using data_collection to disable user info, allowList only safe headers such as x-request-id, exclude HTTP bodies, and turn off database query data where needed.
  • Improving edge-case visibility for unmatched routes via correct user context capture before routing in 5.14.0+. Example: If a cache miss causes a cascade failure, we’ll see the full trace—from HTTP request to DB query—without adding logging code, and we can control exactly which sensitive fields are included."*
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.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk