FLARE_DAEMON_BUFFER_BYTES, FLARE_DAEMON_FLUSH_AFTER_SECONDS) mitigate upstream API rate limits and transient failures. This is critical for Laravel apps with bursty traffic patterns (e.g., marketing campaigns).register() method in a service provider, with config published to config/flare.php for environment variables (e.g., FLARE_DAEMON_LISTEN).Artisan can spawn the daemon as a background process (e.g., via Process::start()), or integrate with Supervisor/Systemd for production. The PHAR/Docker options simplify deployment.127.0.0.1:8787/health) and route payloads accordingly. This requires minimal changes to existing error handlers (e.g., App\Exceptions\Handler).storage/app/flare_buffers).Process facade with signal handling (SIGINT/SIGTERM) to ensure graceful shutdown and buffer flushing.benchmark() in PHP 8.0+).FLARE_DAEMON_BUFFER_BYTES) may require documentation for ops teams. Consider exposing these via Laravel’s config system.App\Exceptions\Handler). Plan for:
/metrics endpoint).127.0.0.1:8787) exposed to untrusted networks? If not, how will you secure it (e.g., Unix socket instead of TCP)?App\Exceptions\Handler to route exceptions to the daemon. Example:
public function report(Throwable $exception)
{
if ($this->shouldUseDaemon()) {
http_post('http://127.0.0.1:8787/v1/errors', [
'json' => $this->preparePayload($exception),
]);
} else {
parent::report($exception);
}
}
Monolog handler to forward logs to the daemon. Use the spatie/flare-logger package if available.FlarePayloadSent) and have a worker forward them to the daemon.ghcr.io/spatie/flare-daemon image as a sidecar in Kubernetes or Docker Compose. Example:
services:
app:
build: .
flare-daemon:
image: ghcr.io/spatie/flare-daemon
ports:
- "8787:8787"
environment:
FLARE_DAEMON_LISTEN: "0.0.0.0:8787" # Expose to app network
FLARE_DAEMON_UPSTREAM: "https://ingress.flareapp.io"
composer.json as a dev dependency (e.g., spatie/flare-daemon:^0.0.1) and include it in Docker builds.composer require spatie/flare-daemon in your deployment scripts.500 errors only) to route through the daemon.FLARE_DAEMON_VERBOSE=true).curl http://localhost:8787/health).FLARE_DAEMON_BUFFER_BYTES and FLARE_DAEMON_FLUSH_AFTER_SECONDS based on traffic patterns.spatie/laravel-flare or spatie/ignition packages. Verify the client’s Flare facade supports daemon detection.ext-zlib is mandatory. Ensure your Laravel runtime includes it (common in most setups).spatie/laravel-flare).ext-zlib enabled.How can I help you explore Laravel packages today?