opentelemetry-instrumentation-confluent-kafka
OpenTelemetry Confluent Kafka instrumentation
What it is and what it does
This package is an OpenTelemetry instrumentation plugin that automatically captures Kafka operations from the confluent-kafka library and exports them as distributed traces. It wraps confluent-kafka calls to emit span data compatible with OpenTelemetry collectors, allowing you to observe message flow, latency, and errors across your Kafka infrastructure without modifying application code.
The package integrates with opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, and wrapt for transparent function wrapping. It targets Python 3.10 and later and is actively maintained, though marked as beta, indicating the API may evolve.
Use it for:
- Monitor Kafka producer and consumer latency and throughput in microservice architectures using distributed tracing backends.
- Correlate Kafka message operations with upstream and downstream service calls in end-to-end trace visualization.
- Debug message delivery failures and consumer lag by inspecting span attributes and error telemetry.
- Collect Kafka operation metrics for SLO tracking and alerting in observability platforms.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds distributed tracing to confluent-kafka library calls, capturing Kafka producer and consumer operations as OpenTelemetry spans for observability.
Yes, if you are already using OpenTelemetry and confluent-kafka together. Low install friction, active maintenance, no security issues, and permissive licensing make it a straightforward addition to tracing-enabled systems. The beta status is not a blocker for production use in established observability setups, but verify confluent-kafka version compatibility for your deployment.
Install
opentelemetry-instrumentation-confluent-kafka on PyPI
pip
pip install opentelemetry-instrumentation-confluent-kafkauv
uv add opentelemetry-instrumentation-confluent-kafkapoetry
poetry add opentelemetry-instrumentation-confluent-kafkaInstalling opentelemetry-instrumentation-confluent-kafka
Before you install
Low friction installation with a small, stable dependency tree (4 runtime deps). Active maintenance with recent release; beta status indicates ongoing development but no known security issues.
License in practice
Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.
Quickstart
pip install opentelemetry-instrumentation-confluent-kafka
import opentelemetry.instrumentation.confluent_kafka
from opentelemetry.instrumentation.confluent_kafka import ConfluentKafkaInstrumentor
ConfluentKafkaInstrumentor().instrument()
Requires Python 3.10 or later; confluent-kafka library must be installed separately.
Verify before relying
- Whether this instrumentation works with all confluent-kafka versions or has specific version constraints.
- Performance overhead of tracing on high-throughput Kafka workloads.
- Specific span attributes and semantic conventions used for Kafka operations.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt |
| Maintenance | actively maintained — 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,742,389/month — #2,508 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentelemetry_instrumentation_confluent_kafka-0.65b0-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
opentelemetry-instrumentation-aiokafkaAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-kafka-pythonAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-cassandraAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-botoAdds distributed tracing to AWS SDK (Boto)…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-remouladeAdds distributed tracing instrumentation for…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-celeryAdds distributed tracing and observability to…
permissive · top 5,000 on PyPI
kafka-schema-registryIntegrates Kafka with Confluent Schema Registry…
permissive · top 15,000 on PyPI
kafka-python-ngA Python client library for Apache Kafka that…
permissive · top 5,000 on PyPI
py-zipkinpy_zipkin provides context managers and…
permissive · top 15,000 on PyPI
confluent-kafka-stubsProvides type hints and stubs for the…
permissive · top 5,000 on PyPI