@@ -35,11 +35,6 @@ The Kafka clients API provides a way to "intercept" messages before they are sen
3535The OpenTelemetry instrumented Kafka library provides two interceptors to be configured to add tracing information automatically.
3636The interceptor class has to be set in the properties bag used to create the Kafka client.
3737
38- ##### Recommended approach: Configuring interceptors with KafkaTelemetry
39-
40- The recommended way to use interceptors is to configure them with a ` KafkaTelemetry ` instance.
41- Interceptors will use system properties for additional configuration like captured headers and receive telemetry settings.
42-
4338For the producer:
4439
4540``` java
@@ -65,29 +60,6 @@ props.putAll(telemetry.consumerInterceptorConfigProperties());
6560Consumer<String , String > consumer = new KafkaConsumer<> (props);
6661```
6762
68- ##### Alternative: Using interceptors with global OpenTelemetry
69-
70- If you don't explicitly configure the interceptors with a ` KafkaTelemetry ` instance, they will fall back to using
71- ` GlobalOpenTelemetry.get() ` and system properties for configuration.
72-
73- Use the ` OpenTelemetryProducerInterceptor ` for the producer in order to create a "send" span automatically, each time a message is sent.
74-
75- ``` java
76- props. setProperty(ProducerConfig . INTERCEPTOR_CLASSES_CONFIG , OpenTelemetryProducerInterceptor . class. getName());
77- ```
78-
79- Use the ` OpenTelemetryConsumerInterceptor ` for the consumer in order to create a "receive" span automatically, each time a message is received.
80-
81- ``` java
82- props. setProperty(ConsumerConfig . INTERCEPTOR_CLASSES_CONFIG , OpenTelemetryConsumerInterceptor . class. getName());
83- ```
84-
85- Note: The ` TracingProducerInterceptor ` and ` TracingConsumerInterceptor ` classes are still available for backwards compatibility, but new code should use the ` OpenTelemetry* ` variants.
86-
87- The interceptors will use the following system properties for configuration:
88- - ` otel.instrumentation.messaging.experimental.receive-telemetry.enabled ` - Enable receive telemetry (default: false)
89- - ` otel.instrumentation.messaging.experimental.capture-headers ` - List of headers to capture as span attributes
90-
9163#### Wrapping clients
9264
9365The other way is by wrapping the Kafka client with a tracing enabled Kafka client.
0 commit comments