Traffic Trace
In order to enable tracing there are two steps that have to be taken:
On Kubernetes we can run kumactl install tracing | kubectl apply -f -
to deploy Jaeger automatically in a kuma-tracing
namespace.
A tracing backend must be first specified in a resource. Once added, the tracing backend will be available for use in the TrafficTrace
resource.
While most commonly we want all the traces to be sent to the same tracing backend, we can optionally create multiple tracing backends in a Mesh
resource and store traces for different paths of our service traffic in different backends (by leveraging Kuma Tags). This is especially useful when we want traces to never leave a world region, or a cloud, among other examples.
The types supported are:
zipkin
. You can also use this with Jaeger since it supports Zipkin compatible traces.
We will apply the configuration with kubectl apply -f [..]
.
We will apply the configuration with kumactl apply -f [..]
or via the .
We can also specify a defaultBackend
property that will be used if any TrafficTrace
resource doesn’t explictly specify a tracing backend.
Add a TrafficTrace resource
Once we have added a tracing backend, we can now create TrafficTrace
resources that will determine how we are going to collecting traces, and what backend we should be using to store them.
We will apply the configuration with kubectl apply -f [..]
.
We can use Kuma Tags to apply the TrafficTrace
resource in a more target way to a subset of data plane proxies as opposed to all of them (like we do in the example by using the service: '*'
selector),
It is important that we instrument our services to preserve the trace chain between requests that are made across different services. We can either use a library in the language of our choice, or we can manually pass the following headers:
x-request-id
x-b3-traceid
x-b3-spanid
x-b3-sampled
As noted before, Envoy’s Zipkin tracer is also .
On the current version of Kuma, because of a limitation of Envoy, every time we create, update or delete a TrafficTrace
resource we need to restart the data plane proxies in order to successfully apply the tracing configuration.
A fix has already been merged in Envoy and we are waiting for its new release (most likely v1.15) before we can update Kuma to remove this limitation.