spatie/flare-debug-sender
Debug sender for Flare payloads, mainly for internal testing. Swap Flare’s sender to log, inspect, and optionally passthrough errors/traces/zipkin, replace tracing IDs/timestamps, and print parts or the full payload via configurable channels.
Purpose Alignment: The package is a lightweight, Flare v3-specific debugging tool designed to intercept and log payloads locally (e.g., via Ray, Laravel logs, or files) without requiring external Flare infrastructure. This aligns perfectly with observability-driven development and pre-deployment validation for Flare v3 integrations.
Extensibility: The package follows a plugin-like architecture with:
RayDebugChannel, LaravelLogDebugChannel, FileDebugChannel) for output routing.CurlSender with SSL bypass options) to mock HTTP behavior.replace_tracing_ids, passthrough_errors) to simulate real-world scenarios.Isolation: Operates as a drop-in replacement for Flare’s default sender, ensuring zero impact on production workflows during debugging.
flare.php config.flare:debug-send).sendUsing() method, but lacks Laravel-specific conveniences (e.g., log channels).| Risk Area | Assessment | Mitigation |
|---|---|---|
| Flare v3 Lock-in | Tight coupling with Flare v3’s payload structure may complicate future upgrades or migrations to other APM tools. | Evaluate abstraction layers (e.g., wrapper classes) if multi-APM support is a future need. Monitor Spatie’s Flare roadmap for backward-compatibility guarantees. |
| SSL/HTTPS Bypass | Default CurlSender disables SSL verification (CURLOPT_SSL_VERIFYPEER => 0), risking man-in-the-middle attacks in production-like tests. |
Restrict usage to dev/QA only. Use environment-specific configs (e.g., .env) to enforce SSL checks in non-debug contexts. |
| Payload Privacy | Local logging (e.g., FileDebugChannel) may expose sensitive data (e.g., API keys, PII) in debug files. |
Implement sanitization middleware (e.g., filter out password, api_key fields) or use temporary debug files with auto-deletion. |
| Performance Overhead | Debug channels (e.g., Ray, Laravel logs) may introduce latency if misconfigured (e.g., synchronous writes). | Benchmark channel performance in staging. Use asynchronous channels (e.g., queue-based logging) for high-throughput debugging. |
| Channel Dependency | Some channels (e.g., RayDebugChannel) require Ray or Laravel Log to be installed, adding friction for non-Laravel projects. |
Document minimum dependencies clearly. Provide a fallback channel (e.g., StdoutDebugChannel) for minimal setups. |
| Testing Coverage | Low GitHub stars (0) and minimal changelog entries suggest limited real-world validation. | Conduct internal load testing with Flare v3 payloads. Contribute to the project if critical bugs are found (MIT license allows modifications). |
| Version Skew | Flare v3’s payload structure may evolve post-v2.0.0, risking package incompatibility. | Monitor Spatie’s Flare releases. Plan for quarterly compatibility reviews during Flare v3 adoption. |
Flare v3 Adoption:
Debugging Workflow:
dd() dumps, staging deployments)?Security & Compliance:
Operational Impact:
Alternatives:
flare:test commands) or third-party alternatives (e.g., Laravel Telescope for local debugging)?Primary Use Case: Laravel + Flare v3 environments.
Dependency Graph:
Your Laravel App
↓
Spatie/Flare v3.x (required)
↓
spatie/flare-debug-sender v2.0.0 (debugging layer)
↓
Optional: Ray, Laravel Log, or custom channels
Compatibility Matrix:
| Component | Version Support | Notes |
|---|---|---|
| Laravel | 8.x, 9.x, 10.x | Tested on latest LTS versions. |
| PHP | 8.0+ | Aligns with Flare v3’s PHP requirements. |
| Flare | v3.0+ | Hard requirement. Incompatible with Flare v2. |
| Ray | Latest | Required for RayDebugChannel. |
| Channels | File, Laravel Log, Ray, Custom | Extensible via channel config. |
Pre-Integration:
flare.php and error handlers before migration.Installation:
composer require spatie/flare-debug-sender
php artisan vendor:publish --tag=flare-config
config/flare.php to use FlareDebugSender:
'sender' => [
'class' => \Spatie\FlareDebugSender\FlareDebugSender::class,
'config' => [
// Channel: RayDebugChannel (default), LaravelLogDebugChannel, or FileDebugChannel
'channel' => \Spatie\FlareDebugSender\Channels\RayDebugChannel::class,
// SSL bypass for testing (disable in production!)
'sender_config' => [
'curl_options' => [CURLOPT_SSL_VER
How can I help you explore Laravel packages today?