Get up and running with OpenTelemetry for PHP.
This is the OpenTelemetry PHP documentation. OpenTelemetry is an observability framework – an API, SDK, and tools that are designed to aid in the generation and collection of application telemetry data such as metrics, logs, and traces. This documentation is designed to help you understand how to get started using OpenTelemetry PHP.
Status and Releases
The current status of the major functional components for OpenTelemetry PHP is as follows:
OpenTelemetry for PHP requires a minimum PHP version of 7.4, and auto-instrumentation requires version 8.0+.
Some of the
Contrib packages have a dependency on both a
HTTP Factories (PSR-17) and a
implementation. You can find appropriate composer packages implementing given
standards on packagist.org.
Optional PHP extensions
|ext-grpc||Required to use gRPC as a transport for the OTLP exporter|
|ext-mbstring||More performant than the fallback, |
|ext-zlib||If you want to compress exported data|
|ext-ffi||Fiber-based context storage|
|ext-protobuf||Significant performance improvement for otlp+protobuf exporting|
Fibers support can be enabled by setting the
environment variable to
true. Using fibers with non-
CLI SAPIs may require
preloading of bindings. One way to achieve this is setting
src/Context/fiber/zend_observer_fiber.h and setting
The native protobuf library is significantly slower than the extension. We strongly encourage the use of the extension.
OpenTelemetry for PHP is distributed via
packagist, in a number of
packages. We recommend that you install only the packages that you need, which
as a minimum is usually
SDK and an exporter.
We strongly encourage that your code only depend on classes and interfaces in
Manual instrumentation for OpenTelemetry PHP
Context propagation for the PHP API