[id='propagation_rest_tracing_{context}']
= Enabling tracing propagation between {brandname} Server and REST API

When you enable tracing propagation between the {brandname} Server and REST API, you must configure tracing on both the client side and the server side.

To propagate the OpenTelemetry tracing spans to the {brandname} spans, you must set the trace context on each REST invocation.

.Prerequisite
* Have tracing enabled on {brandname} Server and remote client side.

.Procedure
. Extract the current tracing context using the `io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator`.
+
The extraction produces a context map that stores trace context information.
. Pass the context map in the header of the REST call to ensure that the trace context is preserved.
+
[source,java]
----
include::code_examples/RESTTracingPropagation.java[]
----

The tracing spans that the client application generates are correlated with the dependent spans generated by the {brandname} Server.

[role="_additional-resources"]
.Additional resources
* link:{server_docs}#opentelemetry-tracing[Enabling {brandname} tracing]
* link:{hotrod_docs}#propagation-hotrod-client-tracing[Hot Rod client tracing propagation]