Weave 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
Prometheus Metrics Bundle

Prometheus Metrics Bundle Laravel Package

l3tum/prometheus-metrics-bundle

A Symfony bundle that exposes Prometheus metrics from your PHP application. Collect counters, gauges and histograms, serve them on a scrape endpoint, and let Prometheus monitor your app's health and performance with minimal setup.

View on GitHub
Deep Wiki
Context7

l3tum/prometheus-metrics-bundle exposes your Symfony application's metrics to Prometheus for scraping and monitoring. It integrates directly with the prometheus_client_php library, letting you register counters, gauges, and histograms through the container and collect them on a dedicated metrics endpoint.

  • Seamless Symfony DI integration with autowired metric services
  • Configurable metrics endpoint for Prometheus scraping
  • Support for counters, gauges, and histograms
  • Pluggable storage adapters (Redis, APC, in-memory)
  • Simple YAML configuration for namespaces and collectors
Frequently asked questions about Prometheus Metrics Bundle
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.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console