// This assembly is included in the following assemblies:
//
// configuring/configuring.adoc

[id='assembly-distributed-tracing-procedures-{context}']
= Setting up distributed tracing

[role="_abstract"]
Enable distributed tracing in Kafka components by specifying a tracing type in the custom resource.
Instrument tracers in Kafka clients for end-to-end tracking of messages.

To set up distributed tracing, follow these procedures in order:

* xref:proc-enabling-tracing-in-connect-mirror-maker-bridge-resources-{context}[Enable tracing for supported Kafka components]

* xref:proc-configuring-tracers-kafka-clients-{context}[Initialize a tracer for Kafka clients]

* Instrument clients with tracers, embedding telemetry-gathering functionality into the code:

** xref:proc-instrumenting-producers-consumers-for-tracing-{context}[Instrument producers and consumers for tracing]

** xref:proc-instrumenting-kafka-streams-with-tracers-{context}[Instrument Kafka Streams applications for tracing]

== Prerequisites

Before setting up distributed tracing, make sure backend components are deployed to your Kubernetes cluster. 

We recommend using the Jaeger operator for deploying Jaeger on your Kubernetes cluster.
For deployment instructions, see the {JaegerDocs}.

NOTE: Setting up tracing systems is outside the scope of this content. 

include::../../modules/tracing/proc-enabling-tracing-in-connect-mirror-maker-bridge-resources.adoc[leveloffset=+1]
include::../../modules/tracing/proc-configuring-tracers-kafka-clients.adoc[leveloffset=+1]
include::../../modules/tracing/proc-instrumenting-producers-consumers-tracing.adoc[leveloffset=+1]
include::../../modules/tracing/proc-instrumenting-kafka-streams-with-tracers.adoc[leveloffset=+1]
include::../../modules/tracing/proc-enabling-tracing-type.adoc[leveloffset=+1]
include::../../modules/tracing/ref-tracing-span-names.adoc[leveloffset=+1]

