Weave Code
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

Laravel Flare Laravel Package

spatie/laravel-flare

Send Laravel 11+ production errors to Flare for tracking, alerts, and shareable public reports. Configure with a Flare API key to capture exceptions automatically. Supports PHP 8.2+ and integrates cleanly alongside Laravel Ignition.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Observability-First Fit: spatie/laravel-flare is a first-class observability solution for Laravel, designed to integrate seamlessly with Flare, a SaaS-based error tracking and performance monitoring platform. It aligns perfectly with modern Laravel architectures (v11+) that prioritize distributed tracing, logging, and error monitoring as core observability pillars.

  • OpenTelemetry Alignment: The package leverages OpenTelemetry log format for logs and integrates with Flare’s distributed tracing capabilities, making it compatible with broader observability ecosystems (e.g., OpenTelemetry collectors, backends like Jaeger, or third-party APM tools).

  • Modular Design: The package follows Laravel’s service provider pattern, allowing for granular configuration (e.g., sampling, log levels, senders) without monolithic dependencies. Key components:

    • Log Channel: Dedicated flare channel in config/logging.php for log forwarding.
    • Samplers: RateSampler, DynamicSampler for selective trace collection (e.g., by route, queue, or custom rules).
    • Senders: LaravelHttpSender (default) and DaemonSender (for local Flare daemon routing).
    • Context Recorders: Built-in support for Livewire, queues, HTTP requests, database queries, and custom collectors.
  • Laravel Ecosystem Synergy:

    • Livewire Integration: Native support for Livewire v4 (SFCs, traces, stack traces).
    • Queue/Job Telemetry: Tracks queue jobs, connections, and failures.
    • HTTP/Performance: Measures request durations, response sizes, and external HTTP calls.
    • Database: Captures query bindings, execution times, and slow queries.
    • Custom Collectors: Extensible via flare.collects config for domain-specific telemetry (e.g., payment gateways, third-party APIs).

Integration Feasibility

  • Low-Coupling Design: The package does not modify core Laravel behavior but hooks into existing systems (e.g., exception handlers, log channels, middleware). This minimizes refactoring risk and allows for opt-in telemetry.
  • Configuration-Driven: Most features are disabled by default (e.g., traces, logs) and require explicit configuration in config/flare.php or .env. This reduces unintended overhead in production.
  • Backward Compatibility: Supports Laravel 11–13+ and PHP 8.2+, with deprecation warnings for older versions. The 3.0.x series is a breaking change but provides clear upgrade paths (e.g., UPGRADING.md).
  • Flare SaaS Dependency: Requires a Flare API key (free tier available), which may introduce vendor lock-in for advanced features (e.g., error solutions, dashboards). However, raw telemetry can be exported to other tools via Flare’s API.

Technical Risk

Risk Area Assessment Mitigation
Performance Overhead Logs/traces are sampled by default (configurable via RateSampler/DynamicSampler). Unoptimized setups (e.g., 100% sampling) may impact latency. Use selective sampling (e.g., DynamicSampler for critical routes only) and monitor flare:monitor command for bottlenecks.
Data Privacy/Security Sensitive data (e.g., cookies, session, request bodies) is censored by default, but misconfiguration could expose PII. Audit flare.php for censor rules and use environment-specific configs (e.g., config/flare-local.php for dev).
Flare API Dependencies Network latency or Flare API downtime could block error reporting. The DaemonSender mitigates this but adds local infrastructure requirements. Prefer DaemonSender in production for offline resilience. Use fallback logging (e.g., single channel) if Flare is unavailable.
Breaking Changes 3.0.x removed error-solutions and reportMessage() in favor of logging. Migration requires updating exception handlers and custom reporters. Follow UPGRADING.md and test in staging before rollout. Use feature flags to toggle Flare during transition.
Livewire/Octane Edge Cases Livewire v4 and Octane support is recent (post-2.7.0). Edge cases (e.g., SFCs, async jobs) may require tuning. Test with real-world workloads and monitor Flare’s Livewire traces for gaps.
Log Volume Explosion Enabling logs at debug level could flood Flare with noise. Configure minimal_log_level (e.g., info) and use sampling to limit volume.

Key Questions for TPM

  1. Observability Strategy:
    • Is Flare the primary observability tool, or will it complement existing solutions (e.g., Sentry, Datadog, ELK)?
    • If hybrid, how will data duplication (e.g., logs to Flare + ELK) be managed?
  2. Sampling Strategy:
    • What percentage of traces/logs should be sampled in production? (Default: RateSampler(10%).)
    • Are there critical paths (e.g., payment flows) that require 100% sampling?
  3. Data Sensitivity:
    • Are there custom collectors (e.g., for payment data) that need additional censoring?
    • How will PII in logs (e.g., user emails in stack traces) be handled?
  4. Cost vs. Value:
    • What is the budget for Flare’s SaaS tier? (Free tier limits may apply.)
    • Are there cost-saving measures (e.g., sampling, log level filtering) to reduce Flare usage?
  5. Migration Path:
    • Is the team ready for 3.0.x breaking changes (e.g., logging over exceptions)?
    • Are there legacy reporters (e.g., reportMessage()) that need replacement?
  6. Operational Ownership:
    • Who will monitor Flare alerts and triage errors?
    • How will false positives (e.g., 404s for static assets) be handled?
  7. Infrastructure Impact:
    • Will the DaemonSender be used for offline resilience, or is LaravelHttpSender sufficient?
    • Are there firewall/proxy requirements for Flare API endpoints?

Integration Approach

Stack Fit

  • Laravel Core: Fully compatible with Laravel 11–13+, PHP 8.2+. Leverages:
    • Exception Handling: Integrates with App\Exceptions\Handler.
    • Logging: Adds flare channel to config/logging.php.
    • Middleware: Optional AddFlareMiddleware for request/response telemetry.
    • Queues: Tracks job failures and performance.
  • Ecosystem Extensions:
    • Livewire: Automatic trace collection for components/methods.
    • Octane: Supports async job and HTTP request telemetry.
    • Vapor: Optimized for AWS Lambda (fixed queue sampling issues in 2.2.4).
    • Testing: flare:test command for CI/CD error reporting.
  • Third-Party Synergy:
    • OpenTelemetry: Logs/traces use OTLP format for interoperability.
    • Flare Daemon: Local proxy for offline resilience (requires spatie/flare-daemon-php).
    • Custom Collectors: Extend via flare.collects for domain-specific telemetry (e.g., Stripe, Twilio).

Migration Path

Phase Action Items Dependencies
Pre-Integration 1. Audit Current Observability: Document existing error logging (e.g., Monolog, Sentry) and performance tools. DevOps, SRE
2. Flare Account Setup: Create Flare account, generate API key, and configure .env (FLARE_API_KEY). Security, Cloud Team
3. Stack Compatibility Check: Verify Laravel/PHP versions meet requirements (11.47+/12.42+/13+, PHP 8.2+). Engineering
Pilot Integration 4. Install Package: composer require spatie/laravel-flare.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai