- How do I install prismamedia/metrics in a Laravel application?
- Install it with Composer using composer require prismamedia/metrics, then register the package service provider and publish any configuration your app needs. Because the package plugs in through a service provider and storage adapters, most setup work is choosing and configuring the metric backend. Before installing, confirm the package constraints resolve against your Laravel, PHP, and Symfony component versions.
- Does prismamedia/metrics support Laravel 11 and Symfony 7?
- Version 2.1.0 adds Symfony 7 support, and Symfony 7 is the component generation used by Laravel 11 and newer, so this release is what allows installation on a modern Laravel stack without dependency-conflict workarounds. That said, CI running on new PHP versions confirms the maintainers are exercising them; it is not a formal support commitment. Check the declared php and symfony/* constraints in composer.json for your exact version before assuming support.
- What PHP version does prismamedia/metrics require?
- Symfony 7 requires PHP 8.2 or higher, so if v2.1.0 resolves Symfony 7 for your application, your effective PHP floor may rise. The release notes do not state a PHP minimum explicitly, so verify the declared php constraint in the package's composer.json rather than inferring it from the changelog. If your wider dependency graph includes older PHP versions, confirm the full matrix resolves before upgrading.
- How do I define and record metrics with this package?
- You define named metrics in your application, record values at the points in your code where events occur, and retrieve aggregated time-series data through the package's API. The workflow is intentionally simple and Eloquent-friendly, so you do not need a separate monitoring service to capture and query values. Start by identifying the few metrics that matter, such as request counts or job durations, then instrument those call sites.
- Which storage backends can prismamedia/metrics use?
- The package supports storage adapters such as Redis, APCu, and in-memory storage, selected through its service-provider configuration. If you use Redis, check whether your application uses predis or phpredis, because the adapter's client expectations matter. Custom collector implementations that extend package classes are the most likely place a minor release could introduce breakage, so review them when upgrading.
- Is upgrading from 2.0.1 to 2.1.0 a drop-in change?
- Version 2.1.0 is a compatibility-widening release rather than a feature release: it adds Symfony 7 support and expands the CI test matrix, with no stated changes to the public instrumentation API. In practice the upgrade is a version-constraint change, not a code change. Run composer why-not prismamedia/metrics 2.1.0 first, then bump in a non-production environment and run your existing metric-emission tests.
- Does prismamedia/metrics require an external monitoring service?
- No. The package captures metrics inside your application and lets you query aggregated time-series data through its own API, so you do not need a hosted monitoring service to get started. If you already run Prometheus, you can expose a scrape endpoint or push to a Prometheus Pushgateway. The package sits at the observability edge of your architecture rather than in the request path's critical logic.
- Why will Composer not install prismamedia/metrics 2.1.0?
- Use composer why-not prismamedia/metrics 2.1.0 to see which constraint is blocking resolution. The blocker is usually the Symfony component version, the PHP version, or a transitive dependency such as a Prometheus client library. If it does not resolve cleanly, stay on v2.0.1 and schedule the Symfony or PHP upgrade as its own workstream rather than forcing the install with ignore-platform-reqs.
- What are the production risks of adopting v2.1.0?
- Technical risk is low if the dependency constraints resolve, but there are caveats. The release may silently raise your PHP floor through Symfony 7, CI coverage is not the same as a contractual support policy, and the changelog is a summary rather than a diff, so adapter behaviour such as key formats or TTL semantics should be regression-tested. Custom collectors are the most likely source of subtle breakage.
- Is prismamedia/metrics actively maintained, and what are the alternatives?
- The project has two named contributors and recent compatibility work for Symfony 7 and newer PHP versions, but no published support or deprecation policy is documented, so treat the observed support matrix as practical rather than guaranteed. If you need a lower-level option, using a Prometheus client library directly is the main alternative, at the cost of more wiring. Before committing, check whether a stable 3.x roadmap exists that would make 2.1.0 a short-lived waypoint.