Configure Dapr to send distributed tracing data

    It is recommended to run Dapr with tracing enabled for any production scenario. You can configure Dapr to send tracing and telemetry data to many backends based on your environment, whether it is running in the cloud or on-premises.

    The section under the Configuration spec contains the following properties:

    The following table lists the properties for tracing:

    The following steps show you how to configure Dapr to send distributed tracing data to Zipkin running as a container on your local machine and view them.

    For self hosted mode, create a Dapr configuration file locally and reference it with the Dapr CLI.

      1. apiVersion: dapr.io/v1alpha1
      2. metadata:
      3. namespace: default
      4. spec:
      5. tracing:
      6. samplingRate: "1"
      7. zipkin:
      8. endpointAddress: "http://localhost:9411/api/v2/spans"
    1. Launch Dapr with the param with the path for where the config.yaml is saved :

    The following steps show you how to configure Dapr to send distributed tracing data to Zipkin running as a container in your Kubernetes cluster, and how to view them.

    First, deploy Zipkin:

    1. kubectl create deployment zipkin --image openzipkin/zipkin

    Create a Kubernetes Service for the Zipkin pod:

    1. kubectl expose deployment zipkin --type ClusterIP --port 9411

    Finally, deploy the Dapr configuration:

    1. kubectl apply -f config.yaml

    In order to enable this configuration for your Dapr sidecar, add the following annotation to your pod spec template:

    1. annotations:
    2. dapr.io/config: "zipkin"

    That’s it! Your sidecar is now configured for use with Zipkin.

    Viewing Tracing Data

    To view traces, connect to the Zipkin service and open the UI:

    On your browser, go to http://localhost:9411 and you should see the Zipkin UI.