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.
Architecture Fit
The movemoveapp/laravel-prometheus package extends Laravel’s observability capabilities by integrating Prometheus metrics collection via a Redis-backed storage layer. It aligns well with Laravel’s service container, event-driven architecture, and existing monitoring stacks (e.g., Prometheus, Grafana). The fork’s primary value lies in its backward-compatible support for predis/predis ^3.0, addressing a critical dependency gap in the original package. This makes it particularly relevant for Laravel applications leveraging Redis for caching, queues, or session storage, where Prometheus metrics need to be collected efficiently.
Integration Feasibility Integration is highly feasible with minimal friction for Laravel applications. The package leverages Laravel’s native service provider system, requiring only:
movemoveapp/laravel-prometheus).config/app.php.php artisan vendor:publish).REDIS_CLIENT=predis in .env).The lack of breaking changes in this release ensures zero-code migration for existing users of the original package. However, teams must explicitly opt into predis/predis ^3.0 support if using Redis, which may require dependency updates.
Technical Risk
predis/predis ^3.0 support) is optional and only relevant for Redis-dependent applications. Teams not using Redis face no technical risk.movemoveapp is unproven (0 stars, no dependents). Monitor for updates or consider the original package if stability is critical.^3.0 may introduce minor behavioral changes (e.g., API adjustments). Test thoroughly if migrating from ^2.0.Key Questions
predis/predis)? If so, is ^3.0 support a requirement (e.g., for new features) or preference (e.g., to future-proof)?predis/predis ^2.0 or other)? Will upgrading to ^3.0 introduce compatibility risks?/metrics endpoint and visualize data.movemoveapp’s long-term commitment to this fork acceptable? If not, consider the original package or alternatives like spatie/laravel-monitoring.Stack Fit The package is optimized for Laravel ecosystems and integrates seamlessly with:
PrometheusServiceProvider).make:counter, make:gauge) for metric generation.predis/predis for Redis-backed metrics storage (optional but recommended for scalability).REDIS_CLIENT=predis in .env./metrics endpoint in Prometheus text format (default: /prometheus/metrics).AuthCounter for auth events).Migration Path
predis/predis version compatibility.composer require movemoveapp/laravel-prometheus
composer require predis/predis:^3.0 # Only if using Redis
config/app.php:
Shureban\LaravelPrometheus\PrometheusServiceProvider::class,
php artisan vendor:publish --provider="Shureban\LaravelPrometheus\PrometheusServiceProvider"
.env:
REDIS_CLIENT=predis
php artisan make:counter AuthEvents --name=auth_events --labels=event,user_type --description="Auth-related events"
app/Prometheus/AuthCounter.php).public function register(AuthCounter $authCounter) {
$authCounter->withLabelsValues(['event' => 'registration'])->inc();
}
/prometheus/metrics is accessible (e.g., via Laravel routes or reverse proxy).curl http://localhost/prometheus/metrics.prometheus.yml:
scrape_configs:
- job_name: 'laravel_app'
static_configs:
- targets: ['laravel-app:8000']
Compatibility
predis/predis and use alternative backends (if supported).symfony/cache).prometheus/client_php).spatie/laravel-monitoring.Sequencing
user_id, country) for granularity./metrics endpoint and Redis latency (if applicable).Maintenance
movemoveapp for updates. Monitor for:
^3.0 issues).^3.0 updates for breaking changes.movemoveapp/laravel-prometheus to a specific version in composer.json to avoid unexpected updates.predis/predis and theHow can I help you explore Laravel packages today?