Introducing @platformatic/kafka-opentelemetry
Production-Ready Observability for Kafka Applications

Search for a command to run...
Production-Ready Observability for Kafka Applications

No comments yet. Be the first to comment.
Nitro is a server toolkit used by many JavaScript applications. You can use it on its own for APIs or full-stack servers, or combine it with Vite to get a familiar frontend workflow with a Nitro serve

All durable execution engines give the same versioning advice: pin your runs. Temporal pins runs to worker builds. Vercel's Workflow SDK pins each run to the deployment that started it. Azure Durable

Eve organizes AI agents in a simple way: use Markdown for instructions and skills, TypeScript for tools, and separate files for channels, schedules, and subagents. Behind this setup, Eve relies on the

Picture an online store launching a new product and sending out a mailing list campaign. Thousands of users click the same link at once. The product page, built with a Node.js app like Next.js, needs

How Platformatic ICC Outperforms AWS ECS Target Tracking and Step Scaling

We're excited to announce the release of @platformatic/kafka-opentelemetry, a comprehensive OpenTelemetry instrumentation package that brings enterprise-grade observability to your Kafka applications built with @platformatic/kafka.
Modern distributed systems rely heavily on Apache Kafka for reliable message streaming, but gaining visibility into message flows, performance bottlenecks, and error patterns across your Kafka infrastructure has traditionally been challenging. With the growing adoption of OpenTelemetry as the standard for observability, we recognized the need for seamless integration between Platformatic's Kafka library and the OpenTelemetry ecosystem.
Get started with comprehensive Kafka tracing in just a few lines of code. The instrumentation automatically detects and traces all producer and consumer operations without requiring changes to your existing Kafka code.
Distributed Tracing: Full producer and consumer trace spans with proper parent-child relationships
Metrics Collection: Counters for sent/consumed messages and duration histograms for operations
Error Tracking: Automatic capture and correlation of Kafka errors with traces
Follows official OpenTelemetry semantic conventions for messaging systems, ensuring compatibility with all major observability platforms, including Jaeger, Zipkin, Honeycomb, DataDog, and more.
Built using Node.js's native diagnostic_channel rather than monkey patching, ensuring reliable and performant instrumentation that won't interfere with your application's behavior.
npm install @platformatic/kafka-opentelemetry
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'
import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-node'
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-node'
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { KafkaInstrumentation } from '@platformatic/kafka-opentelemetry'
// Initialize OpenTelemetry
const provider = new NodeTracerProvider()
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()))
provider.register()
// Register Kafka instrumentation
registerInstrumentations({ instrumentations: [new KafkaInstrumentation()]})
// Your existing Kafka code now automatically generates traces!
import { Producer, Consumer } from '@platformatic/kafka'
The instrumentation provides comprehensive visibility into:
Producer Operations: Message publishing with topic, partition, and key attributes
Consumer Operations: Message processing with full context propagation
API Operations: Internal Kafka protocol operations (Metadata, Produce, Fetch, etc.)
Error Conditions: Failed sends, processing errors, and connection issues
Beyond tracing, you'll get essential Kafka metrics automatically:
messaging.client.sent.messages - Track producer throughput
messaging.client.consumed.messages - Monitor consumer processing
messaging.client.operation.duration - Kafka API operation latency
messaging.process.duration - Message processing time
Whether you're building microservices, event-driven architectures, or real-time data pipelines, this instrumentation gives you the observability foundation needed for:
Performance Monitoring: Identify slow consumers and producers
Error Tracking: Quick root cause analysis of message failures
Capacity Planning: Understand traffic patterns and scaling needs
SLA Monitoring: Track message processing latency and success rates
Built with full TypeScript support, providing an excellent developer experience with strong typing and IntelliSense support throughout.
The package is available on npm and ready for production use. The GitHub repository has detailed documentation, examples, and contribution guidelines.
We're excited to see how this helps teams gain better visibility into their Kafka-based systems. Try it out and let us know what you think!
Built with ❤️ by the Platformatic team. Licensed under Apache-2.0.