Apache Kafka Streams
OpenTelemetry Java agent instrumentation
This instrumentation enables messaging spans for Kafka Streams processing.
- Name:
kafka-streams-0.11 - Scope:
io.opentelemetry.kafka-streams-0.11 - Target versions:
org.apache.kafka:kafka-streams:[0.11.0.0,) - Library: https://kafka.apache.org/documentation/streams/
Telemetry
When default
Spans
| Span kind | Attributes |
|---|---|
| CONSUMER | messaging.client_id (STRING), messaging.destination.name (STRING), messaging.destination.partition.id (STRING), messaging.kafka.cluster.id (STRING), messaging.kafka.consumer.group (STRING), messaging.kafka.message.key (STRING), messaging.kafka.message.offset (LONG), messaging.message.body.size (LONG), messaging.operation (STRING), messaging.system (STRING) |
When otel.instrumentation.kafka.experimental-span-attributes=true
Spans
| Span kind | Attributes |
|---|---|
| CONSUMER | kafka.record.queue_time_ms (LONG), messaging.client_id (STRING), messaging.destination.name (STRING), messaging.destination.partition.id (STRING), messaging.kafka.cluster.id (STRING), messaging.kafka.consumer.group (STRING), messaging.kafka.message.key (STRING), messaging.kafka.message.offset (LONG), messaging.message.body.size (LONG), messaging.operation (STRING), messaging.system (STRING) |
When otel.semconv-stability.preview=messaging
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
messaging.process.duration | histogram | HISTOGRAM | s | Duration of processing operation. |
| Metric | Attributes |
|---|---|
messaging.process.duration | messaging.consumer.group.name (STRING), messaging.destination.name (STRING), messaging.destination.partition.id (STRING), messaging.operation.name (STRING), messaging.system (STRING) |
Spans
| Span kind | Attributes |
|---|---|
| CONSUMER | messaging.client.id (STRING), messaging.consumer.group.name (STRING), messaging.destination.name (STRING), messaging.destination.partition.id (STRING), messaging.kafka.cluster.id (STRING), messaging.kafka.message.key (STRING), messaging.kafka.offset (LONG), messaging.operation.name (STRING), messaging.operation.type (STRING), messaging.system (STRING) |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
otel.instrumentation.messaging.experimental.capture-headers | list | Deprecated: use otel.instrumentation.common.messaging.headers.included instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0. A comma-separated list of header names to capture as span attributes. It does not support glob patterns: an entry containing * or ? is ignored with a warning, and every other entry is matched as a literal header name. | |
otel.instrumentation.messaging.experimental.headers.excluded | list | Deprecated: use otel.instrumentation.common.messaging.headers.excluded instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0. | |
otel.instrumentation.messaging.experimental.headers.included | list | Deprecated: use otel.instrumentation.common.messaging.headers.included instead. Ignored without a warning under v3-preview; may be removed in a later minor release and will be removed no later than 3.0. | |
otel.instrumentation.messaging.experimental.receive-telemetry.enabled | boolean | false | Deprecated: use otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled instead. It may be removed in the next minor release. |
otel.instrumentation.common.messaging.headers.excluded | list | A comma-separated list of case-sensitive message header name glob patterns to exclude from span attributes. ? matches one character and * matches zero or more characters. Excluded patterns take precedence over included patterns. An absent or empty selector captures no headers; an exclude-only selector captures every header not excluded, which may expose sensitive information. | |
otel.instrumentation.common.messaging.headers.included | list | A comma-separated list of case-sensitive message header name glob patterns to capture as span attributes. ? matches one character and * matches zero or more characters. Excluded patterns take precedence over included patterns. An absent or empty selector captures no headers; an exclude-only selector captures every header not excluded. | |
otel.instrumentation.common.messaging.experimental.receive-telemetry.enabled | boolean | false | Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. |
otel.instrumentation.kafka.experimental-span-attributes | boolean | false | Enables the capture of the experimental consumer attributes kafka.record.queue_time_ms and messaging.kafka.bootstrap.servers. |