6

Traces that should have been sent by dapr runtime to zipkin server somehow fails to reach it.

The situation is the following:

I'm using Docker Desktop on my Windows PC. I have downloaded the sample from dapr repository (https://github.com/dapr/samples/tree/master/hello-docker-compose) which runs perfectly out of the box with docker-compose up.

Then I've added Zipkin support as per dapr documentation:

  1. added this service in the bottom of docker-compose.yml
  zipkin:
    image: "openzipkin/zipkin"
    ports:
      - "9411:9411"
    networks:
      - hello-dapr 
  1. added config.yaml in components folder
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: daprsystem
spec:
  mtls:
    enabled: false
  tracing:
    enabled: true
    exporterType: zipkin
    samplingRate: "1"
    expandParams: true
    includeBody: true
    zipkin:
      endpointAddress: "http://zipkin:9411/api/v2/spans"    

When application runs, it should send traces to the server, but nothing is found in zipkin UI and logs.

Strange thing start to appear in the logs from nodeapp-dapr_1 service: error while reading spiffe id from client cert

pythonapp-dapr_1  | time="2021-03-15T19:14:17.9654602Z" level=debug msg="found mDNS IPv4 address in cache: 172.19.0.7:34549" app_id=pythonapp instance=ce32220407e2 scope=dapr.contrib type=log ver=edge
nodeapp-dapr_1    | time="2021-03-15T19:14:17.9661792Z" level=debug msg="error while reading spiffe id from client cert: unable to retrieve peer auth info. applying default global policy action" app_id=nodeapp instance=773c486b5aac scope=dapr.runtime.grpc.api type=log ver=edge
nodeapp_1         | Got a new order! Order ID: 947
nodeapp_1         | Successfully persisted state.

Additional info - current dapr version used is 1.0.1. I made sure that security (mtls) is disabled in config file.

Lukas Nespor
  • 1,238
  • 1
  • 14
  • 22
the_virt
  • 707
  • 4
  • 10

1 Answers1

4

Configuration file is supposed to be in different folder then components.

  1. Create new folder e.g. dapr next to the components folder.
  2. Move components folder into newly created dapr folder.
  3. Then create config.yaml in dapr folder.
  4. Update docker-compose accordingly.

docker-compose

services:
  nodeapp-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
     "-app-id", "nodeapp",
     "-app-port", "3000",
     "-placement-host-address", "placement:50006",
     "-dapr-grpc-port", "50002",
     "-components-path", "/dapr/components",
     "-config", "/dapr/config.yaml"]
    volumes:
      - "./dapr/components/:/dapr"
    depends_on:
      - nodeapp
    network_mode: "service:nodeapp"

config.yaml

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: daprConfig
spec:
  mtls:
    enabled: false
  tracing:
    enabled: true
    samplingRate: "1"
    expandParams: true
    includeBody: true
    zipkin:
      endpointAddress: http://host.docker.internal:9411/api/v2/spans

I had issue with localhost and 127.0.0.1 in URL which I resolved using host.docker.internal as hostname.

PS: Don't forget to kill all *-dapr_1 containers so it can load new configuration.

Lukas Nespor
  • 1,238
  • 1
  • 14
  • 22