This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/spring-kafka-2.7.md.

Spring Kafka

OpenTelemetry Java agent instrumentation

This instrumentation enables consumer messaging spans for Spring Kafka listeners.

  • Name: spring-kafka-2.7
  • Scope: io.opentelemetry.spring-kafka-2.7
  • Target versions: org.springframework.kafka:spring-kafka:[2.7.0,)
  • Library: https://spring.io/projects/spring-kafka

Telemetry

  • Span attributes: messaging.batch.message_count, messaging.client_id, messaging.destination.name, messaging.destination.partition.id, messaging.kafka.consumer.group, messaging.kafka.message.key, messaging.kafka.message.offset, messaging.message.body.size, messaging.operation, messaging.system, kafka.record.queue_time_ms

Configuration

OptionTypeDefaultDescription
otel.instrumentation.messaging.experimental.capture-headerslistA comma-separated list of header names to capture as span attributes.
otel.instrumentation.kafka.experimental-span-attributesbooleanfalseEnables the capture of the experimental consumer attribute kafka.record.queue_time_ms and messaging.kafka.bootstrap.servers.
otel.instrumentation.messaging.experimental.receive-telemetry.enabledbooleanfalseEnables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace.

Data

  • JSON: /data/javaagent/instrumentations/spring-kafka-2.7/spring-kafka-2.7-21d373c19aea.json
  • Explore: /java-agent/instrumentation/spring-kafka-2.7