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.5(1mo ago)1248.6k↑26.4%Apache-2.0PHPPHP ^8.2CI passing

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 2w ago

READMEChangelog (5)Dependencies (39)Versions (6)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

51

—

FairBetter than 95% of packages

Maintenance93

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor2

2 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 ~175 days

Total

5

Last Release

54d 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] (5 commits)")[![brettmc](https://avatars.githubusercontent.com/u/4978962?v=4)](https://github.com/brettmc "brettmc (2 commits)")[![ChrisLightfootWild](https://avatars.githubusercontent.com/u/106102472?v=4)](https://github.com/ChrisLightfootWild "ChrisLightfootWild (2 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)")[![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)")

---

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

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

OpenTelemetry auto-instrumentation for Symfony

571.8M5](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.9M4](/packages/open-telemetry-opentelemetry-auto-pdo)[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).

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

OpenTelemetry auto-instrumentation for Wordpress

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

PHPackages © 2026

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