- Can I use ijanki/prometheus-bundle in a Laravel application?
- No. ijanki/prometheus-bundle is a Symfony bundle whose only job is dependency-injection wiring inside a Symfony service container using YAML configuration and service tags, and Laravel has no bundle concept. In a Laravel app, register the maintained PromPHP prometheus_client_php client as a singleton in a service provider and expose a /metrics route instead.
- What is ijanki/prometheus-bundle used for?
- It integrates the Prometheus client library into Symfony so you can register counters, gauges, and histograms and expose them at a scrape-ready endpoint for a Prometheus server. Configuration lives in familiar Symfony YAML, and collectors can be registered through service tags or configuration. It is aimed at tracking request counts, latencies, and custom business metrics.
- Is ijanki/prometheus-bundle still maintained?
- Effectively no. The last release shipped in December 2018, it targets the Symfony 3/4 era, it has one star and zero dependents, and it pins the deprecated TweedeGolf prometheus_client_php client, which has been succeeded by the community fork PromPHP. Keeping an unmaintained package in your dependency graph is also a standing security and audit liability, so treat the bundle as a reference implementation rather than a dependency.
- How do I install and configure ijanki/prometheus-bundle in Symfony?
- In a legacy Symfony app you would require the package with Composer, enable the bundle, and configure the storage adapter and collectors in YAML, tagging services as collectors so the container wires them up. The bundle then registers the metrics endpoint so Prometheus can scrape it. Before attempting this, verify Composer resolution against your PHP constraint, Symfony container version, PSR-11 interface version, and chosen storage adapter, because the package has not been validated on modern runtimes.
- What is the Laravel equivalent of this Prometheus bundle?
- Build a small internal package instead of installing the bundle: a service provider that registers the PromPHP client as a singleton, binds a storage adapter, and registers a /metrics route returning the Prometheus exposition format. Add middleware that records request counts and latencies as counters and histograms. That reproduces the bundle's intent in roughly 150 lines on a supported dependency.
- Does ijanki/prometheus-bundle work with Laravel 10, Laravel 11, or PHP 8.1+?
- Very likely not. The bundle targets the Symfony 3/4 era and the deprecated TweedeGolf client, while Laravel 10 and 11 require PHP 8.1+ and modern PSR-11 container contracts, so installation or runtime behavior will almost certainly break. Even if Composer resolution somehow succeeds, you would be maintaining an abandoned wrapper for no benefit.
- Which metric types does the bundle support?
- The bundle wires the Prometheus client so you can register counters, gauges, and histograms, which cover request counts, durations, queue depths, and custom business metrics. Support for summaries depends on the underlying client version you resolve. Whichever types you use, set a cardinality budget before adding labels such as user ID, request ID, or raw URL.
- Which storage adapter should I use in production: APCu, Redis, or in-memory?
- For multi-instance deployments, back the client with Redis; APCu is per-process, so metrics fragment across PHP-FPM workers and scrapes become inconsistent. In a Laravel app you can reuse the application's existing Redis connection for the storage adapter, which is the pragmatic choice. Use the in-memory adapter only for tests and CLI runs.
- How do I test Prometheus metrics in a Laravel app?
- Use the in-memory storage adapter in your test suite, update counters and observe histograms directly, then assert the registry values. Add a feature test that hits the /metrics route and checks the exposition format output. Do not depend on the abandoned bundle for this; the same tests apply to a service provider built on the PromPHP client.
- What are the alternatives to ijanki/prometheus-bundle for Laravel monitoring?
- The realistic options are the maintained PromPHP prometheus_client_php client behind a Laravel service provider, or the OpenTelemetry PHP SDK with a Prometheus exporter if you also want traces and metrics together. If you already run an observability stack such as Datadog or an existing Prometheus client, this bundle adds nothing. No maintained Laravel-specific port of this bundle exists, so extract the pattern rather than the package.