PHPackages                             launchdarkly/server-sdk-otel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. launchdarkly/server-sdk-otel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

launchdarkly/server-sdk-otel
============================

LaunchDarkly Server-Side SDK for PHP — OpenTelemetry integration

0.1.0(1mo ago)03Apache-2.0PHPPHP &gt;=8.1CI passing

Since Apr 28Pushed 6d agoCompare

[ Source](https://github.com/launchdarkly/php-server-sdk-otel)[ Packagist](https://packagist.org/packages/launchdarkly/server-sdk-otel)[ Docs](https://github.com/launchdarkly/php-server-sdk-otel)[ RSS](/packages/launchdarkly-server-sdk-otel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

LaunchDarkly Server-Side SDK for PHP — OpenTelemetry integration
================================================================

[](#launchdarkly-server-side-sdk-for-php--opentelemetry-integration)

[![Run CI](https://github.com/launchdarkly/php-server-sdk-otel/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/php-server-sdk-otel/actions/workflows/ci.yml)[![Packagist](https://camo.githubusercontent.com/d541cc2b5187e80630a04f4a3f1be112fa3069821ed27f2f8f6820a43c7902e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61756e63686461726b6c792f7365727665722d73646b2d6f74656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/launchdarkly/server-sdk-otel)[![Documentation](https://camo.githubusercontent.com/594b549773dcf2ae2c08cc82426986546623581e9e74bf421a89b823d9541bd2/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d4769744875622b5061676573266d6573736167653d4150492b7265666572656e636526636f6c6f723d303061646438)](https://launchdarkly.github.io/php-server-sdk-otel)

LaunchDarkly overview
---------------------

[](#launchdarkly-overview)

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

Overview
--------

[](#overview)

This package provides an [OpenTelemetry](https://opentelemetry.io/) integration for the [LaunchDarkly PHP Server-Side SDK](https://github.com/launchdarkly/php-server-sdk). It exposes a `TracingHook` that, when registered with an `LDClient`, enriches the active OpenTelemetry span with a `feature_flag` span event for every flag evaluation. The event carries the semantic-convention attributes defined by the OpenTelemetry feature-flag specification and the LaunchDarkly OTEL integration specification (see [Attributes emitted](#attributes-emitted)).

Reach for this package when you already have OpenTelemetry instrumentation in place and want flag evaluations to show up on the traces that cover them. The hook is a pure consumer of the SDK's hooks API and adds no network or storage dependencies of its own.

Supported PHP versions
----------------------

[](#supported-php-versions)

This package supports PHP 8.1, 8.2, 8.3, and 8.4. It is safe to use under any PHP SAPI (CLI, PHP-FPM, long-running worker pools); see [PHP-FPM and short-lived request lifecycles](#php-fpm-and-short-lived-request-lifecycles) for guidance on flushing spans in request-response environments.

PHP SAPISupportedNotesCLI (scripts, workers)yesNothing to configure.PHP-FPM / mod\_php (web requests)yesSee FPM caveats below — span processors must flush before the request ends.Long-running worker pools (RoadRunner, Swoole, etc.)yesSame rules as CLI; follow your pool's shutdown hooks to flush the tracer provider.Dependencies
------------

[](#dependencies)

DependencyVersion`launchdarkly/server-sdk``>=6.8` (first release exposing the evaluation hooks API)`open-telemetry/api``^1.0``psr/log``^1.0`, `^2.0`, or `^3.0``open-telemetry/api` is interface-only. A runtime OpenTelemetry SDK implementation is also required — typically `open-telemetry/sdk` plus at least one exporter (for example `open-telemetry/exporter-otlp` for OTLP/HTTP). This package does not pull the SDK in for you, since most applications already configure one.

If you are installing this package from source before `launchdarkly/server-sdk` has tagged its first hooks-ready release, you may need to track a compatible branch of the parent SDK until that tag lands.

Installation
------------

[](#installation)

```
composer require launchdarkly/server-sdk-otel
```

Quick start
-----------

[](#quick-start)

```
