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

[id='assembly-distributed-tracing-{context}']
= Distributed tracing

This chapter outlines the support for distributed tracing in {ProductName}, using Jaeger.

How you configure distributed tracing varies by {ProductName} client and component.

* You __instrument__ Kafka Producer, Consumer, and Streams API applications for distributed tracing using an OpenTracing client library. This involves adding instrumentation code to these clients, which monitors the execution of individual transactions in order to generate trace data.

* Distributed tracing support is built in to the Kafka Connect, MirrorMaker, and Kafka Bridge components of {ProductName}. To configure these components for distributed tracing, you configure and update the relevant custom resources.

Before configuring distributed tracing in {ProductName} clients and components, you must first initialize and configure a Jaeger tracer in the Kafka cluster, as described in xref:proc-configuring-jaeger-tracer-kafka-clients-{context}[Initializing a Jaeger tracer for Kafka clients].

NOTE: Distributed tracing is not supported for Kafka brokers.

include::../modules/con-overview-distributed-tracing.adoc[leveloffset=+1]

.Outline of procedures

To set up distributed tracing for {ProductName}, follow these procedures:

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

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

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

* xref:assembly-setting-up-tracing-mirror-maker-connect-bridge-{context}[Set up tracing for MirrorMaker, Kafka Connect, and the Kafka Bridge]

This chapter covers setting up distributed tracing for {ProductName} clients and components only. Setting up distributed tracing for applications and systems beyond {ProductName} is outside the scope of this chapter. To learn more about this subject, see the {OpenTracingDocs} and search for "inject and extract".

.Before you start

Before you set up distributed tracing for {ProductName}, it is helpful to understand:

* The basics of OpenTracing, including key concepts such as traces, spans, and tracers. Refer to the {OpenTracingDocs}.
* The components of the {JaegerArch}. 

.Prerequisites

* The Jaeger backend components are deployed to your Kubernetes cluster. For deployment instructions, see the https://www.jaegertracing.io/docs/1.14/deployment/[Jaeger deployment documentation^].

include::assembly-setting-up-tracing-kafka-clients.adoc[leveloffset=+1]

include::assembly-instrumenting-kafka-clients-tracers.adoc[leveloffset=+1]

include::assembly-setting-up-tracing-mirror-maker-connect-bridge.adoc[leveloffset=+1]
