Download the PHP package open-telemetry/opentelemetry-auto-ext-rdkafka without Composer
On this page you can find all versions of the php package open-telemetry/opentelemetry-auto-ext-rdkafka. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download open-telemetry/opentelemetry-auto-ext-rdkafka
More information about open-telemetry/opentelemetry-auto-ext-rdkafka
Files in open-telemetry/opentelemetry-auto-ext-rdkafka
Package opentelemetry-auto-ext-rdkafka
Short Description OpenTelemetry auto-instrumentation for ext-rdkafka Kafka Client
License Apache-2.0
Homepage https://opentelemetry.io/docs/php
Informations about the package opentelemetry-auto-ext-rdkafka
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
OpenTelemetry ext-rdkafka auto-instrumentation
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.
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
- Note there is an old method called
\RdKafka\KafkaConsumer::commit
/\RdKafka\KafkaConsumer::commitAsync
- For ending the span when the message offset is committed.
Versions
- Tested on PHP 8.2 and 8.3 with success
Configuration
The extension can be disabled via runtime configuration:
All versions of opentelemetry-auto-ext-rdkafka with dependencies
ext-rdkafka Version *
ext-opentelemetry Version *
open-telemetry/api Version ^1.0
open-telemetry/sem-conv Version ^1.24
composer-runtime-api Version ^2.0