promphp/prometheus_client_php
Prometheus client library for PHP with Redis or APCu-based aggregation (plus in-memory adapter). Register and update counters, gauges, histograms, and summaries via CollectorRegistry, then expose metrics in Prometheus text format for scraping.
Observability Roadmap: Enables standardized metrics collection for PHP applications, aligning with a broader observability strategy (e.g., integrating with Prometheus/Grafana for monitoring, logging, and tracing).
Build vs. Buy: Buy—avoids reinventing Prometheus instrumentation from scratch, reducing dev effort while ensuring compatibility with industry-standard tools.
Use Cases:
Tech Stack Alignment: Ideal for PHP-based systems (Laravel, Symfony) already using Prometheus for other services (e.g., Kubernetes, Go services).
Adopt if:
Look elsewhere if:
promphp/prometheus_push_gateway_php)."This package lets us instrument our PHP services with Prometheus metrics—standardizing how we monitor performance, errors, and usage. It’s a lightweight, battle-tested solution that integrates seamlessly with our existing Grafana dashboards, reducing toil for DevOps while enabling data-driven decisions. For example, we can track API latency spikes or feature adoption in real time, just like our Go/K8s services. The cost? Minimal—just a Redis instance for distributed setups, or zero if we use APCu."
*"This is the de facto Prometheus client for PHP. It’s:
Trade-offs:
Next steps:
composer.json and configure a /metrics endpoint.Let’s prototype this in [Project X] by [date]—it’s a drop-in replacement for our ad-hoc logging."*
How can I help you explore Laravel packages today?