Configure tracing with Telemetry API
Istio provides the ability to configure advanced tracing options, such as sampling rate and adding custom tags to reported spans. This task shows you how to customize the tracing options with Telemetry API.
Before you begin
Ensure that your applications propagate tracing headers as described here6.
Follow the tracing installation guide located under Integrations7 based on your preferred tracing backend to install the appropriate addon and configure your Istio proxies to send traces to the tracing deployment.
Installation
In this example, we will send tracing to zipkin
8 so make sure it is installed:
Enable tracing for mesh
Enable tracing by applying the following configuration:
Customizing Trace sampling
The sampling rate option can be used to control what percentage of requests get reported to your tracing system. This should be configured based upon your traffic in the mesh and the amount of tracing data you want to collect. The default rate is 1%.
Customizing tracing tags
Custom tags can be added to spans based on literals, environmental variables and client request headers in order to provide additional information in spans specific to your environment.
You can customize the tags using any of the three supported options below.
Literal represents a static value that gets added to each span.
Environmental variables can be used where the value of the custom tag is populated from a workload proxy environment variable.
Client request header option can be used to populate tag value from an incoming client request header.
Customizing tracing tag length
By default, the maximum length for the request path included as part of the HttpUrl
span tag is 256.
To modify this maximum length, add the following to your tracing.yaml
file.
Verify the results
You can verify the results with Zipkin UI9.