open-telemetry/api
OpenTelemetry API for PHP provides vendor-neutral interfaces for traces, metrics, logs, and context propagation, letting you instrument applications without binding to a specific backend.
open-telemetry/api is the vendor-neutral contract layer of OpenTelemetry PHP — traces, metrics, logs, baggage, context propagation, and semantic conventions expressed as interfaces (plus a no-op implementation). Choosing it is a decision to instrument our code against an open standard rather than a proprietary APM agent, which keeps backend choice (Datadog, New Relic, Honeycomb, Grafana Tempo, Elastic, self-hosted Collector) a reversible, procurement-level decision instead of a rewrite-level one.LocalRootSpan. That is what makes latency attribution across PHP services and queues feasible as a roadmap item rather than a research spike.Consider adopting when:
open-telemetry/api.Look elsewhere / deprioritize when:
open-telemetry/sdk, an exporter (e.g. exporter-otlp), and Laravel/PSR-15 auto-instrumentation, plus a Collector or OTLP-capable backend. Budget for that bundle, not this package.Adoption caveats to validate before committing:
dependents: 0). Zero direct dependents understates real usage — most consumers pull it transitively via the SDK — but it does mean we must verify the Laravel instrumentation ecosystem ourselves rather than assume it.InstrumentationInterface, ConfigurationResolver deprecated in 1.9.0, event logger in 1.2.0) — expect some churn in instrumentation code and plan for it.For executives — one paragraph:
OpenTelemetry is the industry-standard, vendor-neutral way to collect traces, metrics, and logs, and open-telemetry/api is the PHP contract for it: Apache-2.0 licensed, no cost, no lock-in. Adopting it means the instrumentation we write is a durable asset — we can switch observability vendors or bring telemetry in-house without rewriting application code, which converts a large, hard-to-reverse procurement decision into a routine one. It is the plumbing, not the product: it costs us little to standardize on now and it preserves our options and bargaining position later.
For engineering — the honest summary:
This is the API/abstraction layer only — interfaces plus a no-op implementation. It is what our code and our shared packages should compile against; it does nothing on its own. A working setup is a three-part bundle: open-telemetry/api (what we code against), open-telemetry/sdk (the implementation, added once at the app's composition root), and an exporter plus Laravel/PSR-15 auto-instrumentation (what actually ships data to a Collector). Because uninstrumented code paths resolve to no-ops, it is safe in dev, test, and CI, and we can gate real export by environment. It supports traces with span links and span suppression, metrics including histograms/gauges/observable callbacks, log records with trace correlation, and W3C Trace Context and Baggage propagation with enforced size and entry caps. Engineering rules of thumb: applications require the SDK and exporter; libraries require only the API. Note that PHP 7.4 and 8.0 are no longer supported in the current line, so confirm our runtime baseline; and verify the live release cadence before pinning, since the package metadata's release date appears stale relative to the published 1.10.0 notes.
For the sponsor conversation — the ask: Approve a small, time-boxed spike: wire the API + SDK + OTLP exporter into one representative Laravel service behind a feature flag, emit a handful of spans and an SLI metric, and confirm it flows through a Collector to a backend of our choosing. Success criterion is a working end-to-end trace for one user journey and a defensible per-GB telemetry cost estimate — after which we decide on backend and rollout scope with real data instead of projections.
How can I help you explore Laravel packages today?