DEV.co
Open-Source Observability · open-telemetry

opentelemetry-php

OpenTelemetry PHP is the official PHP instrumentation library for the OpenTelemetry observability framework. It provides distributed tracing, metrics, and logging capabilities via a vendor-neutral API and SDK architecture, enabling integration with multiple telemetry backends.

Source: GitHub — github.com/open-telemetry/opentelemetry-php
901
GitHub stars
227
Forks
PHP
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryopen-telemetry/opentelemetry-php
Owneropen-telemetry
Primary languagePHP
LicenseApache-2.0 — OSI-approved
Stars901
Forks227
Open issues93
Latest releasehas-been-moved (2023-09-07)
Last updated2026-07-07
Sourcehttps://github.com/open-telemetry/opentelemetry-php

What opentelemetry-php is

A monorepo-structured PHP library implementing the OpenTelemetry specification, offering core components (API, SDK, Context), exporters (OTLP, gRPC transport), and propagators (B3). Distributed as Composer packages with support for currently-supported PHP versions per php.net policy.

Quickstart

Get the opentelemetry-php source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/open-telemetry/opentelemetry-php.gitcd opentelemetry-php# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Distributed tracing in microservices

Instrument PHP services to correlate requests across service boundaries using standardized trace context propagation and OTLP export to centralized collectors (Jaeger, DataDog, etc.).

Metrics and observability standardization

Replace custom logging/metrics code with vendor-neutral OpenTelemetry instrumentation to unify observability across polyglot stacks without vendor lock-in.

Production debugging and performance analysis

Capture structured trace data, span attributes, and context propagation to diagnose latency, errors, and dependencies in production PHP applications.

Implementation considerations

  • This is a monorepo with multiple read-only package repositories; use Packagist for dependency management and version tracking of individual components (API, SDK, exporters).
  • Instrumentation requires explicit API calls or auto-instrumentation via contrib packages; manual integration points across application code are common.
  • SDK configuration (tracer providers, exporters, samplers) must be established early in application bootstrap; lazy initialization can complicate context propagation.
  • Exporter choice (OTLP, gRPC, etc.) and backend selection (Jaeger, DataDog, Tempo) drive cost and latency; test export performance under load.
  • PHP version support follows php.net EOL timeline; plan upgrades to avoid unsupported versions.

When to avoid it — and what to weigh

  • Simple single-service applications — If you have a standalone PHP application with no service-to-service calls, the overhead of OpenTelemetry instrumentation may not justify the complexity.
  • Existing monolithic logging pipeline — If your organization has a mature, proprietary logging and monitoring system with no plans to adopt OpenTelemetry ecosystem standards, this adds integration overhead.
  • Minimal observability requirements — If basic error logs and application metrics suffice, OpenTelemetry's distributed tracing and context propagation are unnecessary infrastructure.
  • PHP versions nearing end-of-life — The project drops support for PHP versions within 12 months of EOL; older versions may lack security updates and tooling support.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved open-source license.

Apache-2.0 permits commercial use, modification, and distribution with standard liability disclaimers. Consult legal counsel for specific commercial deployment scenarios (e.g., bundling, SaaS offerings) to ensure compliance with attribution and notice requirements.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

As a telemetry library, consider that traces and metrics may contain sensitive data (credentials, PII, internal IPs). Implement proper span filtering, attribute redaction, and secure transport (gRPC/TLS) to backend collectors. Dependency security: audit transitive dependencies in exporters and transports. No security disclosures or audit information provided in data.

Alternatives to consider

Monolog + custom instrumentation

Simpler for single-service logging; does not provide distributed tracing or vendor-neutral metrics. Requires custom integration logic for multi-service scenarios.

DataDog APM PHP agent

Vendor-specific, often requires minimal code changes; tight integration with DataDog backend but introduces vendor lock-in and proprietary API.

New Relic PHP agent

Turnkey APM with auto-instrumentation; vendor lock-in and licensing costs, less flexible for polyglot or multi-backend observability stacks.

Software development agency

Build on opentelemetry-php with DEV.co software developers

Adopt OpenTelemetry PHP to gain vendor-neutral observability across your microservices. Start with official documentation and Packagist packages—no vendor lock-in.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

opentelemetry-php FAQ

Do I need to modify all my PHP code to use OpenTelemetry?
Core instrumentation requires explicit API calls or framework integration. Contrib packages may provide auto-instrumentation for popular libraries (Laravel, Symfony, etc.), reducing manual work. Check opentelemetry-php-contrib for pre-built integrations.
Which PHP versions are supported?
All officially supported PHP versions per https://www.php.net/supported-versions.php. Support is dropped within 12 months of a version reaching end-of-life. Check the compatibility readme in src/SDK/Common/Dev/Compatibility/ for details.
What is the performance impact of tracing?
Not stated in provided data. Tracing overhead depends on instrumentation density, sampler configuration, and export method. Test in your environment; use sampling (e.g., probabilistic) to control overhead in production.
How do I export traces to my backend (Jaeger, DataDog, etc.)?
Use the OTLP Exporter package with gRPC or HTTP transport, or select a backend-specific exporter from contrib. Configure the exporter endpoint and credentials in SDK setup. Verify backend compatibility with OTLP protocol version.

Work with a software development agency

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If opentelemetry-php is part of your open-source observability roadmap, our team can implement, customize, migrate, and maintain it.

Ready to instrument your PHP services?

Adopt OpenTelemetry PHP to gain vendor-neutral observability across your microservices. Start with official documentation and Packagist packages—no vendor lock-in.