Tracing

The tracing system allows developers to visualize call flows in their infrastructure.

We use OpenTracing. It is an open standard designed for distributed tracing.

Traefik supports three tracing backends: Jaeger, Zipkin and DataDog.

Jaeger

  1. # Tracing definition
  2. [tracing]
  3. # Backend name used to send tracing data
  4. #
  5. # Default: "jaeger"
  6. #
  7. backend = "jaeger"
  8. # Service name used in Jaeger backend
  9. #
  10. # Default: "traefik"
  11. #
  12. serviceName = "traefik"
  13. # Span name limit allows for name truncation in case of very long Frontend/Backend names
  14. # This can prevent certain tracing providers to drop traces that exceed their length limits
  15. #
  16. # Default: 0 - no truncation will occur
  17. #
  18. spanNameLimit = 0
  19. [tracing.jaeger]
  20. # Sampling Server URL is the address of jaeger-agent's HTTP sampling server
  21. #
  22. # Default: "http://localhost:5778/sampling"
  23. #
  24. samplingServerURL = "http://localhost:5778/sampling"
  25. # Sampling Type specifies the type of the sampler: const, probabilistic, rateLimiting
  26. #
  27. # Default: "const"
  28. #
  29. samplingType = "const"
  30. # Sampling Param is a value passed to the sampler.
  31. # Valid values for Param field are:
  32. # - for "const" sampler, 0 or 1 for always false/true respectively
  33. # - for "probabilistic" sampler, a probability between 0 and 1
  34. # - for "rateLimiting" sampler, the number of spans per second
  35. #
  36. # Default: 1.0
  37. #
  38. samplingParam = 1.0
  39. # Local Agent Host Port instructs reporter to send spans to jaeger-agent at this address
  40. #
  41. # Default: "127.0.0.1:6831"
  42. #
  43. localAgentHostPort = "127.0.0.1:6831"
  44. # Trace Context Header Name is the http header name used to propagate tracing context.
  45. # This must be in lower-case to avoid mismatches when decoding incoming headers.
  46. #
  47. # Default: "uber-trace-id"
  48. #
  49. traceContextHeaderName = "uber-trace-id"

Warning

Traefik is only able to send data over compact thrift protocol to the Jaeger agent.

Zipkin

  1. # Tracing definition
  2. [tracing]
  3. # Backend name used to send tracing data
  4. #
  5. # Default: "jaeger"
  6. #
  7. backend = "zipkin"
  8. # Service name used in Zipkin backend
  9. #
  10. # Default: "traefik"
  11. #
  12. serviceName = "traefik"
  13. # Span name limit allows for name truncation in case of very long Frontend/Backend names
  14. # This can prevent certain tracing providers to drop traces that exceed their length limits
  15. #
  16. # Default: 0 - no truncation will occur
  17. #
  18. spanNameLimit = 150
  19. [tracing.zipkin]
  20. # Zipking HTTP endpoint used to send data
  21. #
  22. # Default: "http://localhost:9411/api/v1/spans"
  23. #
  24. httpEndpoint = "http://localhost:9411/api/v1/spans"
  25. # Enable Zipkin debug
  26. #
  27. # Default: false
  28. #
  29. debug = false
  30. # Use ZipKin SameSpan RPC style traces
  31. #
  32. # Default: false
  33. #
  34. sameSpan = false
  35. # Use ZipKin 128 bit root span IDs
  36. #
  37. # Default: true
  38. #
  39. id128Bit = true

DataDog

  1. # Tracing definition
  2. [tracing]
  3. # Backend name used to send tracing data
  4. #
  5. # Default: "jaeger"
  6. #
  7. backend = "datadog"
  8. # Service name used in DataDog backend
  9. #
  10. # Default: "traefik"
  11. #
  12. serviceName = "traefik"
  13. # Span name limit allows for name truncation in case of very long Frontend/Backend names
  14. # This can prevent certain tracing providers to drop traces that exceed their length limits
  15. #
  16. # Default: 0 - no truncation will occur
  17. #
  18. spanNameLimit = 100
  19. [tracing.datadog]
  20. # Local Agent Host Port instructs reporter to send spans to datadog-tracing-agent at this address
  21. #
  22. # Default: "127.0.0.1:8126"
  23. #
  24. localAgentHostPort = "127.0.0.1:8126"
  25. # Enable DataDog debug
  26. #
  27. # Default: false
  28. #
  29. debug = false
  30. # Apply shared tag in a form of Key:Value to all the traces
  31. #
  32. # Default: ""
  33. #
  34. globalTag = ""
  35. # Enable priority sampling. When using distributed tracing, this option must be enabled in order
  36. # to get all the parts of a distributed trace sampled.
  37. #
  38. # Default: false
  39. #
  40. prioritySampling = false