From dd090327c0a3dfee00512b0d139dddb5c06804db Mon Sep 17 00:00:00 2001 From: "Heiko W. Rupp" Date: Thu, 18 Aug 2022 09:32:48 +0200 Subject: [PATCH] Make it more obvious how to do propagation. --- docs/src/main/asciidoc/opentelemetry.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/opentelemetry.adoc b/docs/src/main/asciidoc/opentelemetry.adoc index e2199046c1343..42c2342c9adfb 100644 --- a/docs/src/main/asciidoc/opentelemetry.adoc +++ b/docs/src/main/asciidoc/opentelemetry.adoc @@ -424,10 +424,11 @@ we are able to propagate the span into the Kafka Record with: [source,java] ---- -Metadata.of(TracingMetadata.withPrevious(Context.current())); +TracingMetadata tm = TracingMetadata.withPrevious(Context.current(); +Message out = Message.of(...).withMetadata(tm); ---- -The above creates a `Metadata` object we can add to the `Message` being produced, +The above creates a `TracingMetadata` object we can add to the `Message` being produced, which retrieves the OpenTelemetry `Context` to extract the current span for propagation. [[configuration-reference]]