PHPackages                             open-feature/otel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. open-feature/otel-hook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

open-feature/otel-hook
======================

The OpenTelemetry hook package for OpenFeature

1.0.0(1y ago)012Apache-2.0PHPPHP ^8

Since Dec 27Pushed 1y ago2 watchersCompare

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

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

OpenFeature OpenTelemetry Hook
==============================

[](#openfeature-opentelemetry-hook)

[![a](https://camo.githubusercontent.com/17e144567dd661fcbef070f93dddc42e62807a539ee3165e47d0ddc507bf15f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736c61636b2d253430636e63662532466f70656e666561747572652d627269676874677265656e3f7374796c653d666c6174266c6f676f3d736c61636b)](https://cloud-native.slack.com/archives/C0344AANLA1)[![Latest Stable Version](https://camo.githubusercontent.com/e01c60716c19fee175724fd4bb50b50e10ba9b02f026729a5b8a56c826457c86/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f6f74656c2d686f6f6b2f76)](https://packagist.org/packages/open-feature/otel-hook)[![Total Downloads](https://camo.githubusercontent.com/46880a0bede148fddf9dbd837bdd404642b31546e1ac4999a86e33b6e7c53ef7/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f6f74656c2d686f6f6b2f646f776e6c6f616473)](https://packagist.org/packages/open-feature/otel-hook)[![PHP 8.0+](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)](https://camo.githubusercontent.com/36d788d0f2d62c47ef64bc13d6f62e5921218d50977830b654730882e0d0f1cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e302d626c75652e737667)[![License](https://camo.githubusercontent.com/2a1da78961e0602f13618efd2641c6fd9027c03e1a7b74f7449ab0ca96e833ff/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d666561747572652f6f74656c2d686f6f6b2f6c6963656e7365)](https://packagist.org/packages/open-feature/otel-hook)

Overview
--------

[](#overview)

OpenTelemetry is an open specification for distributed tracing, metrics, and logging. It defines a semantic convention for feature flagging which is utilized in this hook to report flag evaluations.

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).

### Autoloading

[](#autoloading)

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

### OpenTelemetry Package Status

[](#opentelemetry-package-status)

The OpenTelemetry package for PHP is still in beta, so there could be changes required. However, it exposes global primitives for span retrieval that should not require any configuration upfront for the provider to just work.

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

[](#installation)

```
composer require open-feature/otel-hook
```

Usage
-----

[](#usage)

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

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

```
use OpenFeature\Hooks\OpenTelemetry\OpenTelemetryHook;

OpenTelemetryHook::register();
```

For more information on OpenTelemetry, check out [their documentation](https://opentelemetry.io/docs/instrumentation/php/).

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

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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 ~88 days

Recently: every ~142 days

Total

8

Last Release

620d 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 (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

opentelemetryotelproviderfeatureflagsfeatureflaggingopenfeature

###  Code Quality

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[open-feature/sdk

PHP implementation of the OpenFeature SDK

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

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

531.9M8](/packages/open-telemetry-opentelemetry-auto-laravel)[open-telemetry/opentelemetry-auto-symfony

OpenTelemetry auto-instrumentation for Symfony

551.2M1](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.2M1](/packages/open-telemetry-opentelemetry-auto-pdo)

PHPackages © 2026

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