avto-dev/app-metrics-laravel
Laravel package for collecting and exposing application metrics, with built-in integrations for Prometheus and other backends. Adds middleware and service providers to track requests, responses, and custom counters, helping you monitor performance and health with minimal setup.
Architecture fit: The package is a thin Laravel adapter over the app-metrics collector: an auto-discovered service provider, a publishable config, a facade for counters/gauges/histograms, request-timing middleware, and a Prometheus-compatible HTTP endpoint. That is the right shape for a Laravel estate — it needs no sidecar, no agent, and no vendor SDK, and it composes with any OpenMetrics-aware backend (Prometheus, VictoriaMetrics, Grafana Agent). The current release line targets Laravel ^11.0 through 13.x, which keeps it inside the framework's supported lifecycle rather than anchoring a service to a legacy branch.
Integration feasibility: Technically low effort for a Laravel 11+ service: one Composer dependency, publish the config, register the scrape route, optionally enable the middleware. The real work is not installation — it is deciding what to measure (naming taxonomy, label cardinality, which endpoints and jobs get instrumented) and where the scrape endpoint lives in the network topology. Applications on Laravel 10 or earlier cannot consume v2.10.0 and must pin to the last compatible release or upgrade the framework first.
Technical risk: Three risks matter to a TPM. First, maturity: 4 stars and a low composite score mean almost no community validation — this is effectively a single-maintainer dependency, so evaluate it against a fork-and-own contingency. Second, semver discipline: the release that dropped Laravel 10 shipped as a minor (2.10.0) rather than a major. Any service with a permissive ^2.0 constraint can silently pull a version that cannot resolve against its framework, so constraints must be pinned and changelogs read. Third, observability surface: an unauthenticated metrics route exposes internal traffic patterns and endpoint names; and unbounded label values (user IDs, raw paths, request IDs) will blow up cardinality and the scrape backend. Laravel 13 support also appears to be a constraint/CI bump, not evidence of production hardening.
Key questions:
composer.json, and does it match our fleet (the Docker image moved to PHP 8.5 — is that contributor tooling only)?Stack fit: Best fit is Laravel 11/12/13 on a PHP runtime matching the package's declared constraint, deployed to a scheduler that already scrapes Prometheus-format targets (Kubernetes, ECS, or a static scrape config). It is a poor fit for Laravel ≤10 estates, and a redundant fit for teams already standardized on OpenTelemetry PHP or a commercial APM — in those cases the value is marginal and the second metrics pipeline is a liability.
Migration path: For Laravel 10 estates, pin the package to the last compatible release, complete the framework upgrade, then lift the pin. For Laravel 11/12 estates, treat adoption as a greenfield instrumentation choice, not a migration. If replacing an existing metrics path, dual-publish for one release cycle — keep the old exporter running while the new endpoint is scraped in parallel — then retire the old one after dashboards and alerts are proven on the new source.
Compatibility: Validate the full transitive graph resolves against the exact Laravel minor versions in use, not just the major, and check for packages that cap PHP below the runtime version. Confirm the Prometheus/OpenMetrics text format is accepted by the target backend and that the scrape interval matches the endpoint's cost profile. Confirm the package's metrics registry behaves under Laravel Octane or long-running workers if those are in play — a per-request reset assumption breaks in resident-process runtimes.
Sequencing:
2.10.0 pull.Maintenance: The capability itself is small — a config file and instrumentation calls — so ongoing code maintenance is low. The recurring cost is dependency cadence: the package tracks Laravel's annual major rhythm, so expect a constraint-raising release roughly yearly and fold it into the existing Laravel upgrade programme rather than treating it as a standalone chore. The reduced support matrix (no Laravel 10) lowers the maintainer's CI burden, which should improve reliability on supported versions.
Support: This is the weakest dimension. A 4-star, single-maintainer package with a semver ambiguity is a continuity risk, and there is no commercial support path. Mitigate by pinning exactly, vendoring or mirroring the repository, and confirming a fork is buildable in our CI before it becomes an emergency. Establish explicitly how long each Laravel major remains supported and whether security fixes are backported; assume nothing and read each changelog.
Scaling: Runtime impact is negligible relative to the application. The scaling risks are elsewhere: metric cardinality per service (labels multiply series, and series multiply backend cost), scrape volume once dozens of pods are added as targets, and fleet-wide coordination when a package bump invalidates a framework version. Budget a cardinality ceiling per service and review it at rollout; the container/tooling bumps (PHP 8.5, Composer 2.10.0) improve CI reproducibility across many repos, which helps at scale but also signals dev/prod parity drift worth checking.
Failure modes:
Ramp-up: Low. Any Laravel-fluent engineer can install and instrument in an afternoon; the package introduces no new concepts beyond the Prometheus data model. The TPM's ramp-up work is non-technical: defining the metric taxonomy and ownership, setting the cardinality budget, deciding the endpoint's network posture, and securing a continuity plan. Budget a short discovery spike plus one pilot sprint; full rollout should track the normal service template cadence rather than a dedicated programme.
How can I help you explore Laravel packages today?