mtxserv/metric-bundle
A Symfony bundle for collecting and exposing application metrics, giving developers a simple way to instrument services and report usage data within their projects.
Headline finding: this is not a Laravel/PHP package — it is a Symfony2 bundle. That distinction is disqualifying before any other consideration. The package is built on Symfony's Bundle registration, YAML/XML dependency-injection service definitions, and the Symfony 2.x EventDispatcher API. Laravel uses a different container, different lifecycle (service providers, middleware, terminable middleware), and different configuration conventions. There is no adapter, no bridge, and no shared abstraction. Nothing here can be composer required into a Laravel application and expected to function.
Architecture fit: zero for Laravel. Marginal even within Symfony — Symfony 2.x reached end of life in November 2018, and the bundle's 2016 release date implies a PHP 5.x/early-7.0 codebase with no typed properties, no return type declarations, and no PHP 8 compatibility. Any modern Laravel (PHP 8.1+) or Symfony (6.x/7.x) runtime is a language-level mismatch, not just a framework-level one.
Integration feasibility: not feasible as a dependency. The only defensible use is as a reference implementation. The bundle is almost certainly small — a config tree for host/database/measurement, a thin InfluxDB client wrapper, and one or two kernel event listeners for request timing. That is perhaps 150–400 lines of code. Its value is the instrumentation points it chose, not the code itself.
Technical risk: certainty of negative outcome, not probability.
composer audit and SCA tooling as unfixable noise.Key questions to resolve before any engineering time is spent:
Stack fit: none for the bundle. The correct target is either (a) the OpenTelemetry PHP SDK with an appropriate exporter, or (b) a small in-house Laravel service provider plus middleware if the team wants minimal dependencies. Option (a) is the stronger TPM recommendation: it decouples instrumentation from the metrics backend, so a future InfluxDB→Prometheus or InfluxDB→managed-OTLP migration is a config change rather than a rewrite.
Migration path — reimplement, do not port:
Compatibility notes:
config/*.php publishable config replace them cleanly.EventDispatcher listener pattern maps to Laravel middleware or terminable middleware (terminate() runs after the response is sent — this is actually a better fit for metrics than the original kernel listener).Sequencing:
Estimated effort for the reimplementation: one to two engineer-days for the request-edge instrumentation, assuming the backend already exists. This is cheaper than the due diligence required to responsibly adopt an abandoned bundle.
Maintenance: total ownership transfer. An archived repo means the adopting team becomes the sole maintainer of a fork, including any future InfluxDB protocol changes. There is no upstream to rebase against. Budget this as permanent, if small, carrying cost — or avoid it entirely by reimplementing.
Support: none. No issue triage, no maintainer response, no patch path for a discovered vulnerability. In a regulated or audited environment, this package would require an explicit risk acceptance or a documented exception, which is disproportionate for a request-timing helper.
Scaling: the 2016-era pattern is typically a synchronous HTTP write per request. That is a latency tax on every request and a failure amplifier — when InfluxDB is slow or down, your application degrades with it. Production-grade requires one of: batched async exporter, queue-backed writes, or UDP line protocol with accepted loss. The other scaling hazard is tag cardinality: InfluxDB's classic failure mode is unbounded tag values (user IDs, raw URLs, request IDs) driving memory growth and query collapse. Any tag scheme must be capped and reviewed.
Failure modes to design against:
Ramp-up: near zero, because the recommendation is not to ramp up on this artifact. The learning cost sits in the reimplementation — one engineer familiar with the framework's middleware lifecycle and the chosen client library. The bundle teaches nothing that the OTel documentation does not teach better.
Recommendation: do not adopt. Treat mtxserv/metric-bundle as a two-hour read for pattern inspiration and a one-to-two-day reimplementation against OpenTelemetry or a maintained InfluxDB client. The framework mismatch alone settles it; the archive status and 2016 vintage confirm the decision independently.
How can I help you explore Laravel packages today?