- Can I use l3tum/prometheus-metrics-bundle in Laravel?
- No. It is a Symfony bundle that depends on Symfony's Kernel and Bundle discovery, and Laravel has no equivalent resolution mechanism. The package provides no Laravel ServiceProvider, config publishing, or route file. At best, it is a reference for how to wire the underlying Prometheus PHP client into a container.
- How do I install l3tum/prometheus-metrics-bundle?
- You install it with Composer and register it in a Symfony application's bundles.php. In a Laravel application, Composer may download the code, but nothing will auto-discover or boot the bundle. You would have to manually wire its services yourself, which defeats the purpose of installing it.
- Does l3tum/prometheus-metrics-bundle support Laravel 10 or 11?
- No. The package targets Symfony 4 and 5 and had its last release in February 2021. There is no Laravel service provider, no Laravel support matrix, and no compatibility work for modern Laravel versions. Treat it as a Symfony-only package.
- What is the best Laravel alternative to this Symfony Prometheus bundle?
- Use promphp/prometheus_client_php directly or a maintained Laravel wrapper such as spatie/laravel-prometheus. Both let you register counters, gauges, and histograms and render a /metrics endpoint without Symfony bundle glue. The underlying client is framework-agnostic and is the part that actually transfers to Laravel.
- How do I expose a /metrics endpoint in Laravel for Prometheus scraping?
- Register a registry as a singleton, bind a storage adapter through configuration, and define a Laravel route that returns RenderTextFormat output with the correct content type. Restrict that route with network rules or authentication from day one. This reproduces the bundle's three responsibilities without depending on Symfony.
- Which storage adapter should I use for Prometheus metrics in PHP-FPM?
- The default in-memory adapter records metrics per request and per worker, so scrapes return one worker's partial view and are effectively noise. Use the APCu adapter for same-host aggregation or the Redis adapter when metrics must be shared across hosts. Make this decision before instrumenting, because it changes how counters behave in production.
- How do I test Prometheus metrics in a Laravel application?
- Use the in-memory adapter in tests, reset the registry between test cases, and assert that rendered output contains the expected metric samples and labels. Avoid hitting Redis or APCu in unit tests so results stay deterministic. Test the /metrics route response and content type separately from the instrumentation logic.
- How do I prevent high cardinality in Prometheus metrics?
- Keep label values bounded and predictable. Avoid user IDs, raw URL paths, tenant names, email addresses, and unbounded query strings as labels. Pre-approve label dimensions and enforce them in code review, because nothing in this package or the underlying client prevents cardinality explosions.
- Should I fork l3tum/prometheus-metrics-bundle for Laravel?
- Not recommended. The bundle is roughly 200 lines of Symfony configuration and registration glue maintained by a single maintainer with zero stars and no dependents. Forking means owning that fork to preserve a configuration surface you can reproduce in a small Laravel service provider. Bypass the bundle and use the underlying Prometheus client instead.
- Is l3tum/prometheus-metrics-bundle maintained and production-ready?
- Treat it as archived source. The last release was February 2021, it has zero stars and zero dependents, and Symfony 4 and 5 are end-of-life. No downstream community has exercised it against real load, so bugs would surface as your production incidents. It is not a maintained dependency for a Laravel application.