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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. open-telemetry/opentelemetry-auto-ext-rdkafka

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

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

OpenTelemetry auto-instrumentation for ext-rdkafka Kafka Client

0.0.4(3mo ago)1224.0k↑26.1%Apache-2.0PHPPHP ^8.2

Since Jul 24Pushed 3w 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 3d 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 94% of packages

Maintenance88

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity46

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

102d 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

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (3 commits)")[![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)")[![javespi](https://avatars.githubusercontent.com/u/1534117?v=4)](https://github.com/javespi "javespi (1 commits)")[![pieterocp](https://avatars.githubusercontent.com/u/68863060?v=4)](https://github.com/pieterocp "pieterocp (1 commits)")[![bobstrecansky](https://avatars.githubusercontent.com/u/4099109?v=4)](https://github.com/bobstrecansky "bobstrecansky (1 commits)")[![tom-diacono](https://avatars.githubusercontent.com/u/50292326?v=4)](https://github.com/tom-diacono "tom-diacono (1 commits)")[![ChrisLightfootWild](https://avatars.githubusercontent.com/u/106102472?v=4)](https://github.com/ChrisLightfootWild "ChrisLightfootWild (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

592.7M9](/packages/open-telemetry-opentelemetry-auto-laravel)[open-telemetry/opentelemetry-auto-symfony

OpenTelemetry auto-instrumentation for Symfony

561.6M3](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.7M2](/packages/open-telemetry-opentelemetry-auto-pdo)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17209.2k](/packages/open-telemetry-opentelemetry-auto-wordpress)[traceway/opentelemetry-symfony

Pure-PHP OpenTelemetry instrumentation for Symfony — automatic HTTP, Console, HttpClient, Messenger, Doctrine DBAL, Cache, Twig tracing and Monolog log-trace correlation with response propagation, a lightweight Tracing helper, route templates, and semantic conventions. No C extension required (ext-protobuf recommended for production).

7812.6k](/packages/traceway-opentelemetry-symfony)[shopware/opentelemetry

OpenTelemetry auto-instrumentation for Shopware

1040.3k1](/packages/shopware-opentelemetry)

PHPackages © 2026

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