PHPackages                             open-telemetry/opentelemetry-auto-ext-rdkafka - 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. open-telemetry/opentelemetry-auto-ext-rdkafka

ActiveLibrary

open-telemetry/opentelemetry-auto-ext-rdkafka
=============================================

OpenTelemetry auto-instrumentation for ext-rdkafka Kafka Client

0.0.4(1mo ago)1128.7k↑10.1%Apache-2.0PHPPHP ^8.2

Since Jul 24Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/opentelemetry-php/contrib-auto-ext-rdkafka)[ Packagist](https://packagist.org/packages/open-telemetry/opentelemetry-auto-ext-rdkafka)[ Docs](https://opentelemetry.io/docs/languages/php/)[ RSS](/packages/open-telemetry-opentelemetry-auto-ext-rdkafka/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (26)Versions (5)Used By (0)

This is a read-only subtree split of .

OpenTelemetry ext-rdkafka auto-instrumentation
==============================================

[](#opentelemetry-ext-rdkafka-auto-instrumentation)

Please read  for instructions on how to install and configure the extension and SDK.

Overview
--------

[](#overview)

Auto-instrumentation hooks are registered via composer. There will be a new span created for each message that is consumed. The goal of this instrumentation is to allow distributed traces to happen across Kafka in PHP. This means that the following should happen:

- A span should be created for each message that is consumed
- The span should be created with the correct parent context- should the inbound message contain a traceparent header
- The span should be ended when the message offset is `committed`
- Any messages produced should have the traceparent header injected into the message headers

This is done by hooking into three methods:

- `\RdKafka\KafkaConsumer::consume`- For span creation and context propagation on inbound messages.
- `\RdKafka\ProducerTopic::producev`- For injecting the traceparent header into the message headers of produced messages.
    - Note there is an old method called `produce`. This does not support headers, and thus there was no point hooking into this
- `\RdKafka\KafkaConsumer::commit` / `\RdKafka\KafkaConsumer::commitAsync` - For ending the span when the message offset is committed.

Versions
--------

[](#versions)

- Tested on PHP 8.2 and 8.3 with success

Configuration
-------------

[](#configuration)

The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):

```
OTEL_PHP_DISABLED_INSTRUMENTATIONS=ext-rdkafka
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~202 days

Total

4

Last Release

55d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4978962?v=4)[Brett McBride](/maintainers/brettmc)[@brettmc](https://github.com/brettmc)

![](https://avatars.githubusercontent.com/u/4099109?v=4)[Bob Strecansky](/maintainers/bobstrecansky)[@bobstrecansky](https://github.com/bobstrecansky)

---

Top Contributors

[![brettmc](https://avatars.githubusercontent.com/u/4978962?v=4)](https://github.com/brettmc "brettmc (2 commits)")[![intuibase](https://avatars.githubusercontent.com/u/9551626?v=4)](https://github.com/intuibase "intuibase (1 commits)")[![bobstrecansky](https://avatars.githubusercontent.com/u/4099109?v=4)](https://github.com/bobstrecansky "bobstrecansky (1 commits)")[![pieterocp](https://avatars.githubusercontent.com/u/68863060?v=4)](https://github.com/pieterocp "pieterocp (1 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")[![tom-diacono](https://avatars.githubusercontent.com/u/50292326?v=4)](https://github.com/tom-diacono "tom-diacono (1 commits)")[![javespi](https://avatars.githubusercontent.com/u/1534117?v=4)](https://github.com/javespi "javespi (1 commits)")

---

Tags

tracingopentelemetryotelinstrumentationopen-telemetryext-rdkafka

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-telemetry-opentelemetry-auto-ext-rdkafka/health.svg)

```
[![Health](https://phpackages.com/badges/open-telemetry-opentelemetry-auto-ext-rdkafka/health.svg)](https://phpackages.com/packages/open-telemetry-opentelemetry-auto-ext-rdkafka)
```

###  Alternatives

[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)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)

PHPackages © 2026

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