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

movemoveapp/laravel-prometheus

Laravel package to collect and expose Prometheus metrics using Redis storage. Friendly fork of shureban/laravel-prometheus with support for predis/predis ^3.0. Includes artisan generators for counter and gauge metrics and publishable configuration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability Roadmap: Enables integration of Prometheus metrics into Laravel applications, supporting a shift toward standardized monitoring and metrics collection. Aligns with broader observability initiatives (e.g., SRE practices, APM tooling).
  • Build vs. Buy: Buy—avoids reinventing Prometheus metric collection for Laravel, leveraging a maintained (forked) package with minimal overhead. Justification: Low technical risk, Laravel-native integration, and compatibility with existing Prometheus ecosystems.
  • Use Cases:
    • Performance Tracking: Monitor API response times, database query latency, or job queue processing.
    • Business Metrics: Track user actions (e.g., auth events, feature usage) with labeled counters/gauges.
    • Infrastructure Health: Expose Laravel-specific metrics (e.g., cache hit/miss ratios, queue depth) to Prometheus.
    • Cost Optimization: Reduce reliance on third-party APM tools for basic metrics by self-hosting Prometheus.
  • Tech Debt Reduction: Replaces ad-hoc logging/monitoring with structured metrics, improving data consistency and queryability.
  • Compliance/Reporting: Supports auditable metric collection for regulatory or internal reporting (e.g., "How many failed payments occurred?").

When to Consider This Package

Adopt This Package If:

  • Your Laravel app requires Prometheus metrics (e.g., for dashboards, alerts, or cost monitoring).
  • You already use Redis (or plan to) and need predis/predis ^3.0 compatibility—this fork explicitly addresses that gap.
  • You prioritize low-maintenance observability and want to avoid custom metric collection logic.
  • Your team is familiar with Laravel’s service container and can integrate a new provider/config.
  • You’re using Laravel 11/12 and need a package that supports modern Composer (2.x+).
  • You want to expose metrics via a standard /metrics endpoint without building a custom solution.

Look Elsewhere If:

  • You don’t use Laravel: This package is Laravel-specific; alternatives like prometheus/client_php may fit better.
  • You need advanced Prometheus features (e.g., custom exporters, histogram buckets) not covered by this package’s basic counters/gauges.
  • Your app uses an older Laravel version (<10) or Composer 1.x (unsupported by this fork).
  • You require active maintenance from the original author—this is a community fork with no long-term guarantees.
  • You don’t use Redis and the original shureban/laravel-prometheus works for your use case (no need for the fork).
  • You need real-time streaming metrics (e.g., WebSockets) or multi-tenant metric isolation—this package focuses on batch collection.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us standardize monitoring for our Laravel apps by integrating Prometheus metrics—think of it as ‘Google Analytics for infrastructure.’

  • Why? We’ll gain visibility into performance bottlenecks, user behavior, and system health without relying on expensive third-party tools.
  • How? It’s a lightweight, Laravel-native solution that exposes metrics via a standard /metrics endpoint, compatible with tools like Grafana.
  • Risk? Minimal—it’s a maintained fork of an existing package with no breaking changes. We’ll test it in staging first.
  • ROI? Reduces debugging time, improves incident response, and aligns with our observability roadmap."

For Engineering:

"This is a drop-in Laravel package to collect Prometheus metrics, with two key advantages:

  1. Forked for predis/predis ^3.0: If we use Redis, this ensures compatibility without forking ourselves.
  2. Zero-code instrumentation: Generate metrics via CLI (php artisan make:counter) or manual classes, then inject them into controllers/services.

Use cases:

  • Track auth events, API latency, or job failures with labeled counters.
  • Expose Laravel-specific metrics (e.g., cache stats) to Prometheus.
  • Avoid reinventing metric collection—just publish the /metrics endpoint.

Tradeoffs:

  • Pros: Low maintenance, Laravel-native, supports dynamic labels.
  • Cons: Basic metrics only (no histograms/histograms yet); fork may lack long-term support. Recommendation: Pilot in a non-critical service to validate Redis integration and metric quality."*

For DevOps/SRE:

"This package simplifies Prometheus integration for Laravel apps by:

  • Automating metric collection: Counters/gauges for events, performance, or business metrics.
  • Redis-backed storage: Metrics are stored in Redis (via Predis) before being scraped by Prometheus.
  • Standard endpoint: Exposes /metrics in Prometheus’s expected format.

Why it matters:

  • Reduces alert noise: Structured metrics improve dashboard accuracy.
  • Cost-effective: Self-hosted Prometheus avoids vendor lock-in.
  • Scalable: Works with existing Redis infrastructure.

Gotchas:

  • Ensure Predis ^3.0 doesn’t break existing Redis clients.
  • Test the /metrics endpoint under load—Redis latency could impact scraping."*
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.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php