// Module included in the following assemblies:
//
// assembly-setting-up-tracing-kafka-clients.adoc

[id='ref-tracing-environment-variables-{context}']
= Environment variables for tracing

Use these environment variables when configuring a Jaeger tracer for Kafka clients.

NOTE: The tracing environment variables are part of the Jaeger project and are subject to change. For the latest environment variables, see the https://github.com/jaegertracing/jaeger-client-java/tree/master/jaeger-core#configuration-via-environment[Jaeger documentation^].

[%autowidth.stretch,cols="3*",options="header",stripes="none",separator=¦]
|===

¦Property
¦Required
¦Description

m¦JAEGER_SERVICE_NAME
¦Yes
¦The name of the Jaeger tracer service.

m¦JAEGER_AGENT_HOST
¦No
¦The hostname for communicating with the `jaeger-agent` through the User Datagram Protocol (UDP).

m¦JAEGER_AGENT_PORT
¦No
¦The port used for communicating with the `jaeger-agent` through UDP.

m¦JAEGER_ENDPOINT
¦No
¦The `traces` endpoint. Only define this variable if the client application will bypass the `jaeger-agent` and connect directly to the `jaeger-collector`.

m¦JAEGER_AUTH_TOKEN
¦No
¦The authentication token to send to the endpoint as a bearer token.

m¦JAEGER_USER
¦No
¦The username to send to the endpoint if using basic authentication.

m¦JAEGER_PASSWORD
¦No
¦The password to send to the endpoint if using basic authentication.

m¦JAEGER_PROPAGATION
¦No
¦A comma-separated list of formats to use for propagating the trace context. Defaults to the standard Jaeger format. Valid values are `jaeger`, `b3`, and `w3c`.

m¦JAEGER_REPORTER_LOG_SPANS
¦No
¦Indicates whether the reporter should also log the spans.

m¦JAEGER_REPORTER_MAX_QUEUE_SIZE
¦No
¦The reporter's maximum queue size.

m¦JAEGER_REPORTER_FLUSH_INTERVAL
¦No
¦The reporter's flush interval, in ms. Defines how frequently the Jaeger reporter flushes span batches.

m¦JAEGER_SAMPLER_TYPE
¦No
a¦The sampling strategy to use for client traces:

* Constant
* Probabilistic
* Rate Limiting
* Remote (the default)

To sample all traces, use the Constant sampling strategy with a parameter of 1.

For more information, see the https://www.jaegertracing.io/docs/1.14/sampling/#client-sampling-configuration[Jaeger documentation^].

m¦JAEGER_SAMPLER_PARAM
¦No
¦The sampler parameter (number).

m¦JAEGER_SAMPLER_MANAGER_HOST_PORT
¦No
¦The hostname and port to use if a Remote sampling strategy is selected.

m¦JAEGER_TAGS
¦No
¦A comma-separated list of tracer-level tags that are added to all reported spans.

The value can also refer to an environment variable using the format `${envVarName:default}`. `:default` is optional and identifies a value to use if the environment variable cannot be found.

|===

.Additional resources

* xref:proc-configuring-jaeger-tracer-kafka-clients-{context}[]
