PHP OpenTelemetry APM

Learn how to migrate to OpenTelemetry for PHP.

Complete these tasks to properly integrate OpenTelemetry APM in PHP:

Install PHP

See OpenTelemetry documentation for integrating through PHP.

Run this command to install PHP:

composer require open-telemetry/api open-telemetry/sem-conv

Set Up Instrumentation

OpenTelemetry documentation for Instrumentation clearly describes the basic steps for initializing a tracer and creating spans.

For creating spans using the OpenTelemetry API, the following section is useful: Traces.

Instrumentation Libraries

We recommend that you review the OpenTelemetry documentation on Using instrumentation libraries to automatically instrument standard PHP packages.

Examples

Common code scenarios and some example applications have been instrumented using OpenTelemetry, and shared in the OpenTelemetry documentation stack. See Examples.