arkaitzgarro/elastic-apm-laravel
Integrates Elastic APM with Laravel to monitor application performance. Automatically traces HTTP requests, database queries, and background jobs, sending transaction and span data to the Elastic APM server for analysis and debugging.
Architecture fit. arkaitzgarro/elastic-apm-laravel is a thin Laravel service-provider wrapper around Elastic's official elastic/apm-agent-php extension. It fits cleanly into a conventional Laravel architecture: auto-discovery registers the provider, middleware captures HTTP transactions, and the package hooks the framework's events, exceptions, and query builder to emit spans. There is no data-store footprint, no schema, and no queue worker of its own — instrumentation is in-process, which makes it architecturally low-impact but also means it inherits the constraints of the underlying PHP agent (Zend extension, INI configuration, per-process lifecycle under PHP-FPM/Octane).
Integration feasibility. Mechanically straightforward: composer require, publish config, set ELASTIC_APM_* env vars, confirm the agent extension is loaded. v8.0.0 raises the floor to PHP 8.3+ and adds Laravel 13 support while dropping Laravel 11. That makes this a hard gate rather than an additive feature release — v8 is only installable on Laravel 12/13 with PHP 8.3+. Teams on Laravel 11 are pinned to v7.x and receive no further updates.
Technical risk.
elastic/apm-agent-php extension, whose version compatibility with PHP 8.3/8.4 is a separate constraint from this package's own constraints. Two version matrices must be satisfied simultaneously.Key questions.
elastic/apm-agent-php extension version support the target PHP runtime?Stack fit. Suitable for standard Laravel HTTP + queue workloads on PHP-FPM. Less proven under Octane/long-lived workers, where the agent's per-process assumptions and span flushing need explicit verification. If the stack is Laravel 12 with PHP 8.3 and Elastic APM is already the standard, v8 is a natural, low-friction fit. If Laravel 13 is not yet adopted, v8 delivers no functional benefit — it only removes supported versions.
Migration path. Two distinct paths:
Compatibility. v8.0.0 requires PHP ≥ 8.3 and Laravel 12/13 (Laravel 11 dropped). Pin explicitly — "arkaitzgarro/elastic-apm-laravel": "^8.0" plus a PHP platform constraint in composer.json — so CI and production cannot silently diverge. Verify the elastic/apm-agent-php extension version independently; it is not resolved by Composer.
Sequencing.
Maintenance. Low day-to-day surface — one Composer dependency, one config file, one set of env vars. The real maintenance burden is the recurring forced-upgrade cadence: each Laravel major triggers a corresponding major here, and each one is a breaking release. Budget this as a standing annual line item, not a one-off. Track the upstream repo for releases; there is no vendor support contract behind it.
Support. Community-supported, single maintainer. No SLA, no escalation path, no guaranteed security patch turnaround. Acceptable for internal observability; a material gap if APM data feeds customer-facing SLAs or billing. Mitigation: keep the abstraction thin (config via env, no deep coupling to package internals) so substitution — including a move to OpenTelemetry — remains a bounded effort.
Scaling. Instrumentation cost scales linearly with request volume, not with cluster size. At high RPS, per-request overhead and span volume become the binding constraints: tune sample rate, transaction sample rate, and span compression; size the APM server and Elasticsearch backing store for ingest, not just for storage. Under horizontal autoscaling, remember every new instance must have the agent extension baked into its image — a missed image variant produces silent blind spots rather than errors.
Failure modes.
>=8.3 requirement surfaces as a Composer resolution failure, which is loud and safe. The dangerous variant is a base image still on 8.2 in one environment, producing inconsistent instrumentation across the fleet.service.name and service.environment stable across the cutover.Ramp-up. A competent Laravel engineer can complete the v8 bump on an already-compliant stack in under a day, most of it verification. The real ramp-up is for whoever owns observability: understanding the agent's INI-level configuration (which lives outside Laravel config), the sampling knobs, and the fail-open behavior. That knowledge is scarce and concentrated — document it, and pair the v8 upgrade with a short runbook covering extension installation, env var reference, and the "no data in APM" triage path.
How can I help you explore Laravel packages today?