keepsuit/laravel-opentelemetry
OpenTelemetry integration for Laravel: automatically instrument HTTP requests, database queries, queues, Redis, and more, then export traces and metrics via OTLP to your observability backend. Simple configuration and Laravel-native APIs.
Architecture fit. This package is a Laravel service provider that instruments framework-level seams — HTTP kernel, Eloquent/DB, queues, console commands, cache/Redis, and the Guzzle HTTP client — and emits OpenTelemetry spans through the upstream OTel PHP SDK. For a TPM, the key point is that instrumentation is owned by the framework integration rather than smeared across application code, and the output wire format is OTLP, not a vendor agent protocol. That means the instrumentation decision and the backend decision are decoupled: we can adopt tracing now and defer (or reverse) the vendor choice later. It fits a Laravel monolith or a modest service fleet well. It fits poorly if we already run a vendor SDK with its own auto-instrumentation, because we would be operating two overlapping instrumentation layers.
Integration feasibility. The code-level integration is small: a Composer dependency, a published config file, and OTEL_* environment variables. The real cost is infrastructure and convention — an OTel Collector tier, service naming, resource attributes, sampling policy, and a redaction policy. A credible pilot in one non-critical service is a one-sprint exercise; a production-grade rollout with collector operations is four to six weeks. License is MIT and the dependency footprint is small, so procurement and legal friction are near zero.
Technical risk.
Assessment of 2.2.7. One bug fix, no breaking changes, no config surface change — so the integration plan and migration path don't move. But it matters more than the diff size implies. Failed outbound calls are the spans that drive MTTR and error-rate SLOs; a gap there means trace-derived error rates understate reality, and any parallel-run comparison against an incumbent APM during the pilot would have flattered this package. Two consequences: set a minimum version of 2.2.7 for any pilot so we aren't evaluating a known-defective baseline; and treat any traces collected on ≤2.2.6 as unreliable for outbound error analysis.
Key questions for the team.
Stack fit. Targets modern Laravel (10/11/12) on PHP 8.1+, and composes with the usual suspects: Monolog for log correlation, Guzzle for outbound calls, Redis/SQS/database queues, Eloquent. Because the wire format is OTLP, the same instrumentation feeds Grafana Tempo/Loki/Mimir, Jaeger, Datadog, New Relic, or Honeycomb. Instrumentation stays vendor-neutral and the backend becomes a procurement decision rather than an engineering one — the single strongest argument for this package over a vendor agent. None of this is affected by 2.2.7.
Migration path. Treat the Collector as the architectural boundary from day one: application → OTLP → Collector → backend. Every later change — backend swap, sampling policy, attribute scrubbing — becomes a Collector config change with no redeploy. Pilot in one non-critical service in staging, then production, and run in parallel with the incumbent APM for a quarter. Compare trace completeness, MTTR on real incidents, and cost per span before committing to decommission. Pin the pilot floor at 2.2.7 so outbound failures appear on both sides of the comparison.
Compatibility checks. Pin package and OTel SDK together; upgrade and test as a unit. Verify PHP extension availability in build images (native extension is faster but operationally awkward; pure-PHP is simpler but slower). Validate behaviour under Octane — long-lived workers change how batch buffers and memory behave. Confirm OTEL_* env vars don't collide with existing platform config and that queue workers flush spans on graceful shutdown. Add one acceptance criterion the previous plan missed: after any bump, assert that error paths still emit spans — 2.2.7 is a reminder that coverage can arrive late, at patch level, without ceremony.
Sequencing.
Maintenance. Low steady-state code maintenance, non-trivial dependency maintenance. Budget recurring effort for Renovate-driven upgrades, upstream SDK changelog review, and a quarterly compatibility test against the newest Laravel major. Keep a fork or vendored config overlay so a stalled upstream is an inconvenience rather than an outage. Read patch releases, not just minors — 2.2.7 changes what is visible in production and would have been easy to skip as "just a patch."
Support. No commercial support. Reliance is on GitHub issues and maintainer goodwill, which is not an acceptable primary support model for a tier-1 service. Mitigate by naming an internal owning team (platform/observability), writing an internal runbook, and pre-agreeing the fallback: replace the package with direct OTel SDK instrumentation — a bounded effort precisely because the API surface is standard.
Scaling. The Collector scales horizontally and independently of the application, which is the right decoupling. Cost control lives in sampling: tail-based sampling at the Collector keeps all spans for errors and slow requests while discarding the boring majority. Watch exporter backpressure, agent CPU (typically low single-digit percent), and metric cardinality — user IDs or raw URLs as metric labels will destroy a metrics backend faster than volume will. Note 2.2.7 slightly increases span volume on the error path; negligible in most cases, but retune sampling thresholds if outbound failure rates are high.
Failure modes and mitigations.
Ramp-up. Expect one engineer to reach productive use in a week and the team to be fluent in manual span authoring and trace-based debugging in four to six weeks, gated on two enablers: published conventions (naming, attributes, redaction) and at least one worked example of a business transaction traced end-to-end. TPM-owned deliverables during ramp-up are concrete: the ADR, the success criteria for the pilot (trace completeness, overhead, MTTR delta, cost per span), the named owning team, and a documented rollback to commercial APM. Without those, the technical work will succeed and the organizational adoption will stall.
How can I help you explore Laravel packages today?