PHPackages                             open-feature/dd-trace-hook - 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. open-feature/dd-trace-hook

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

open-feature/dd-trace-hook
==========================

The Datadog dd-trace hook package for OpenFeature

1.0.0(1y ago)02.1kApache-2.0PHPPHP ^8

Since Dec 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/open-feature-php/dd-trace-hook)[ Packagist](https://packagist.org/packages/open-feature/dd-trace-hook)[ RSS](/packages/open-feature-dd-trace-hook/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (23)Versions (9)Used By (0)

OpenFeature DDTrace Hook
========================

[](#openfeature-ddtrace-hook)

[![a](https://camo.githubusercontent.com/17e144567dd661fcbef070f93dddc42e62807a539ee3165e47d0ddc507bf15f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736c61636b2d253430636e63662532466f70656e666561747572652d627269676874677265656e3f7374796c653d666c6174266c6f676f3d736c61636b)](https://cloud-native.slack.com/archives/C0344AANLA1)[![Latest Stable Version](https://camo.githubusercontent.com/6bc2c4394d3d2938082cc4fc1498d184f6234e35c460ebbb6c0f3e0aa82452d0/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f64642d74726163652d686f6f6b2f76)](https://packagist.org/packages/open-feature/dd-trace-hook)[![Total Downloads](https://camo.githubusercontent.com/c5e5048b2189fc75737b5a4a468a1c07f8b76f5e03e9900be69192cd51567742/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f64642d74726163652d686f6f6b2f646f776e6c6f616473)](https://packagist.org/packages/open-feature/dd-trace-hook)[![PHP 8.0+](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)[![License](https://camo.githubusercontent.com/4fc2259de5a73541bbb489ed9f86f8f2efef0ec5aef943d284a89349e39b2542/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f64642d74726163652d686f6f6b2f6c6963656e7365)](https://packagist.org/packages/open-feature/dd-trace-hook)

Overview
--------

[](#overview)

`dd-trace` is the Datadog tracing library for PHP. It is built on the OpenTracing specification.

This package also builds on various PSRs (PHP Standards Recommendations) such as the Logger interfaces (PSR-3) and the Basic and Extended Coding Standards (PSR-1 and PSR-12).

### Design

[](#design)

OpenTracing is now an archived project of the CNCF, with suggestions to move towards OpenTelemetry. Feel free to check out our [OpenTelemetry hook for OpenFeature](../OpenTelemetry/README.md) as well. OpenTelemetry defines a semantic convention for feature flagging which is utilized in this hook to report flag evaluations, which is the basis for the log events being performed in this library for `dd-trace`.

### Autoloading

[](#autoloading)

This package supports Composer autoloading. Thus, simply installing the package is all you need in order to immediately get started with Datadog's DDTrace for OpenFeature! Examples are provided that showcase the simple setup as well. Check out the **Usage** section for more info.

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

[](#installation)

```
composer require open-feature/dd-trace-hook
```

Usage
-----

[](#usage)

The `DDTraceHook` should be registered to the OpenFeatureAPI globally for use across all evaluations.

It makes use of the `dd-trace` packages `Globals` utility for current span retrieval, thus has no dependency on configuration or injection of tracers.

```
use OpenFeature\Hooks\DDTrace\DDTraceHook;

DDTraceHook::register();
```

For more information on DDTrace, check out [their documentation](https://docs.datadoghq.com/tracing/trace_collection/dd_libraries/php?tab=containers).

For more examples, see the [examples](./examples/).

Development
-----------

[](#development)

### PHP Versioning

[](#php-versioning)

This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.

This package also has a `.tool-versions` file for use with PHP version managers like `asdf`.

### Installation and Dependencies

[](#installation-and-dependencies)

Install dependencies with `composer install`. `composer install` will update the `composer.lock` with the most recent compatible versions.

We value having as few runtime dependencies as possible. The addition of any dependencies requires careful consideration and review.

### Testing

[](#testing)

Run tests with `composer run test`.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~142 days

Total

7

Last Release

612d ago

Major Versions

0.8.0 → 1.0.02024-09-04

PHP version history (2 changes)0.0.2PHP ^7.4 || ^8

0.2.0PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/37b811aae08f6063ce4a6c9111849a2c8c5400b58718072c224c9eb8c46e5f17?d=identicon)[0xc](/maintainers/0xc)

---

Top Contributors

[![tcarrio](https://avatars.githubusercontent.com/u/8659099?v=4)](https://github.com/tcarrio "tcarrio (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

DataDogproviderfeatureflagsfeatureflaggingopenfeaturedd-traceddtrace

###  Code Quality

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-feature-dd-trace-hook/health.svg)

```
[![Health](https://phpackages.com/badges/open-feature-dd-trace-hook/health.svg)](https://phpackages.com/packages/open-feature-dd-trace-hook)
```

###  Alternatives

[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)[open-feature/sdk

PHP implementation of the OpenFeature SDK

39514.9k15](/packages/open-feature-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
