Distributed tracing

    Dapr uses the Zipkin protocol for distributed traces and metrics collection. Due to the ubiquity of the Zipkin protocol, many backends are supported out of the box, for examples Stackdriver, , New Relic and others. Combining with the OpenTelemetry Collector, Dapr can export traces to many other backends including but not limted to , Datadog, Instana, , and SignalFX.

    • No need for code instrumentation. All traffic is automatically traced with configurable tracing levels.
    • Consistent tracing behavior across microservices. Tracing is configured and managed on Dapr sidecar so that it remains consistent across services made by different teams and potentially written in different programming languages.
    • Configurable and extensible. By leveraging the Zipkin API and the OpenTelemetry Collector, Dapr tracing can be configured to work with popular tracing backends, including custom backends a customer may have.

    Dapr uses the standard W3C Trace Context headers. For HTTP requests, Dapr uses header. For gRPC requests, Dapr uses header. When a request arrives without a trace ID, Dapr creates a new one. Otherwise, it passes the trace ID along the call chain.

    Read for more background on W3C Trace Context.

    To change the default tracing behavior, use a configuration file (in self hosted mode) or a Kubernetes configuration object (in Kubernetes mode). For example, the following configuration object changes the sample rate to 1 (i.e. every span is sampled), and sends trace using Zipkin protocol to the Zipkin server at http://zipkin.default.svc.cluster.local

    Note: Changing to 0 disables tracing altogether.