Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.57 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.57 KB

Brave Kafka Streams instrumentation [EXPERIMENTAL]

Add decorators for Kafka Streams to enable tracing.

  • KafkaStreamsTracing completes a span on process or processValues

This does not trace all operations by default. See [RATIONALE.md] for why.

Setup

First, setup the generic Kafka Streams component like this:

import brave.kafka.streams.KafkaStreamsTracing;

...

kafkaStreamsTracing = KafkaStreamsTracing.create(tracing);

KIP-820 introduces new processor APIs to the Kafka Streams DSL. You must use version >= v3.4.0 to instrument applications.

To trace a processor in your application use kafkaStreamsTracing.process like so:

builder.stream(inputTopic)
       .process(kafkaStreamsTracing.process(
            "process",
            customProcessor));

or use kafkaStreamsTracing.processValues like so:

builder.stream(inputTopic)
        .processValues(kafkaStreamsTracing.processValues(
            "processValues",
            customProcessor));

For more details, see here.

To create a Kafka Streams with Tracing Client Supplier enabled, pass your topology and configuration like this:

KafkaStreams kafkaStreams = kafkaStreamsTracing.kafkaStreams(topology, streamsConfig);

Notes

  • This tracer is only compatible with Kafka Streams versions including headers support ( > 2.0.0).