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]]