spatie/laravel-prometheus
Export Laravel app metrics to Prometheus via a /prometheus endpoint. Register custom gauges and counters in code, with built-in metrics for queues and Horizon. Includes optional security so your metrics aren’t publicly exposed; pair with Grafana for dashboards.
active_users).queue_jobs_pending > 1000).Adopt if:
api_errors only for HTTP 5xx responses).Look elsewhere if:
/prometheus endpoints (consider middleware restrictions or internal Prometheus servers)."This package lets us instrument our Laravel app with Prometheus—think of it as ‘Google Analytics for infrastructure.’ We’ll get real-time dashboards for queue health, API performance, and custom business metrics (e.g., user activity), all without adding engineers. It integrates with Grafana, so we can set up alerts like ‘Notify me if queue jobs stall for >5 minutes.’ This reduces downtime and helps us optimize costs by spotting inefficiencies early. It’s a low-risk, high-reward move—like adding a ‘check engine’ light for our backend."
ROI:
*"This is a drop-in Prometheus exporter for Laravel that handles the heavy lifting:
Prometheus::addGauge('users')->value(fn() => User::count()) and expose /prometheus.Trade-offs:
Next Steps:
queue_jobs_processed, api_latency).failed_jobs > 0)."*How can I help you explore Laravel packages today?