Traffic Trace

With the TrafficTrace policy you can configure tracing on every Kuma DP that belongs to the Mesh. Note that tracing operates on L7 HTTP traffic, so make sure that selected dataplanes are configured with HTTP Protocol.

You can configure tracing in 3 steps:

  1. Configure tracing backend

On Universal:

  1. type: Mesh
  2. name: default
  3. tracing:
  4. defaultBackend: my-zipkin
  5. backends:
  6. - name: my-zipkin
  7. sampling: 100.0
  8. zipkin:
  9. url: http://zipkin.local:9411/api/v2/spans

On Kubernetes:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: Mesh
  3. metadata:
  4. name: default
  5. spec:
  6. tracing:
  7. defaultBackend: my-zipkin
  8. backends:
  9. - name: my-zipkin
  10. sampling: 100.0
  11. zipkin:
  12. url: http://zipkin.local:9411/api/v2/spans
  1. Select the dataplanes that should send traces for given backend

On Universal:

  1. type: TrafficTrace
  2. mesh: default
  3. name: all
  4. selectors:
  5. - match:
  6. service: '*'
  7. conf:
  8. backend: my-zipkin

On Kubernetes:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: TrafficTrace
  3. mesh: default
  4. metadata:
  5. namespace: kuma-demo
  6. name: default
  7. spec:
  8. selectors:
  9. - match:
  10. service: '*'
  11. conf:
  12. backend: my-zipkin

If a backend in TrafficTrace is not explicitly specified, the defaultBackend from Mesh will be used.

  1. Instrument your service so the trace chain is preserved between services. You can either use a library for the language of your choice or manually pass following headers:
  • x-request-id
  • x-b3-traceid
  • x-b3-parentspanid
  • x-b3-spanid
  • x-b3-sampled
  • x-b3-flags

Envoy’s Zipkin tracer is also compatible with Jaeger through Zipkin V1 HTTP API.Traffic Trace - 图1.

You need to restart Kuma DP for tracing configuration to be applied. This limitation will be solved in the next versions of Kuma.