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 Prometheus Laravel Package

spatie/laravel-prometheus

Export Laravel app metrics to Prometheus via a /prometheus endpoint. Register custom gauges/counters with simple callbacks, use built-in queue and Horizon metrics, and optionally secure the endpoint. Ideal for scraping by Prometheus and charting in Grafana.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability Roadmap: Accelerates adoption of SRE/DevOps best practices by integrating standardized metrics (e.g., HTTP request latency, queue processing, DB queries) into Prometheus/Grafana ecosystems. Aligns with initiatives to reduce MTTR and improve system reliability.
  • Build vs. Buy: Buy—avoids reinventing Prometheus exporters for Laravel (e.g., custom middleware, queue listeners, or database monitoring). Reduces dev effort by ~80% compared to DIY solutions.
  • Use Cases:
    • Performance Monitoring: Track API response times, error rates, and resource usage (CPU, memory) in real-time.
    • Incident Response: Correlate metrics (e.g., queue backlog + slow DB queries) to diagnose bottlenecks faster.
    • Scaling Decisions: Identify underutilized vs. overloaded services for auto-scaling (e.g., Kubernetes HPA).
    • Compliance/Reporting: Export metrics to audit logs or dashboards for SOX/GDPR requirements.
  • Tech Stack Alignment: Enables unified monitoring across polyglot environments (PHP + Node.js + Go) using Prometheus as the backbone.
  • Cost Efficiency: Free (MIT license) and lightweight (~1MB overhead), avoiding proprietary tools like Datadog or New Relic for basic metrics.

When to Consider This Package

  • Adopt if:
    • Your team uses Laravel and needs standardized metrics for Prometheus (e.g., Grafana dashboards, alerting).
    • You’re migrating from custom logging or basic APM tools (e.g., Laravel Debugbar) to a scalable observability stack.
    • You require low-latency metric collection with minimal performance impact (<1% overhead).
    • Your org already uses Prometheus (or plans to) for infrastructure monitoring (e.g., Kubernetes, AWS).
  • Look elsewhere if:
    • You need distributed tracing (use OpenTelemetry or Laravel Telescope).
    • Your app is serverless (e.g., AWS Lambda)—consider Prometheus Push Gateway or CloudWatch.
    • You require advanced APM features (e.g., flame graphs, SQL query analysis)—evaluate Laravel Scout + New Relic or Blackfire.
    • Your team lacks Prometheus/Grafana expertise—pair with a managed service (e.g., Grafana Cloud) or SRE hiring.
    • You’re using non-Laravel PHP frameworks (e.g., Symfony)—check symfony/prometheus-bundle.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us instrument our Laravel apps with industry-standard metrics—like a ‘black box’ for our services—so we can proactively detect issues, optimize performance, and reduce downtime. It’s a low-cost, high-impact way to align with DevOps best practices, similar to how we use Prometheus for infrastructure. No vendor lock-in; we own the data, and it integrates seamlessly with our existing tools. ROI: Faster incident resolution, better scaling decisions, and compliance-ready dashboards—all for the cost of a few developer hours."

For Engineering:

*"spatie/laravel-prometheus gives us first-class Prometheus support out of the box:

  • Automatic metrics: HTTP routes, queues, DB queries, cache hits/misses—no manual instrumentation.
  • Extensible: Add custom metrics (e.g., business KPIs) via Laravel’s service container.
  • Lightweight: Minimal overhead (~1% latency impact) and zero external dependencies.
  • Future-proof: Works with Grafana, Alertmanager, or Thanos for long-term storage. Trade-off: We’ll need to set up Prometheus (but we can use docker-compose or managed Grafana Cloud). Alternatives? Only if we need tracing or non-PHP tools—but this covers 80% of our needs for <20% of the effort."*

For DevOps/SRE:

*"This fills a gap in our Laravel observability stack by:

  1. Standardizing metrics (exposition format, labels, naming conventions) for consistency across teams.
  2. Reducing alert noise by surfacing only actionable data (e.g., laravel_http_request_duration_seconds).
  3. Enabling cross-service correlation (e.g., link API latency to queue depth or DB load). Next steps: We’ll need to:
  • Deploy Prometheus + Grafana (or use a managed service).
  • Define critical alerts (e.g., ‘P99 latency > 1s’).
  • Document how to add custom metrics for non-HTTP workflows (e.g., cron jobs). Blockers? Only if we’re locked into a non-Prometheus monitoring tool."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport