the*_*irt 6 zipkin docker-compose dapr
应该由 dapr 运行时发送到 zipkin 服务器的跟踪不知何故无法到达它。
情况如下:
我在 Windows PC 上使用 Docker Desktop。我已经从 dapr 存储库( https://github.com/dapr/samples/tree/master/hello-docker-compose )下载了示例,该示例与docker-compose up完美开箱即用。
然后我根据 dapr 文档添加了 Zipkin 支持:
zipkin:
image: "openzipkin/zipkin"
ports:
- "9411:9411"
networks:
- hello-dapr
Run Code Online (Sandbox Code Playgroud)
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"
Run Code Online (Sandbox Code Playgroud)
当应用程序运行时,它应该将跟踪发送到服务器,但在 zipkin UI 和日志中找不到任何内容。
nodeapp-dapr_1服务的日志中开始出现奇怪的事情:从客户端证书读取 spiffe id 时出错
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.
Run Code Online (Sandbox Code Playgroud)
附加信息 - 当前使用的 dapr 版本是 1.0.1。我确保配置文件中禁用了安全性(mtls)。
配置文件应该位于不同的文件夹中components。
dapr旁边components。components文件夹移动到新创建的dapr文件夹中。config.yaml然后在文件夹中创建dapr。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"
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
我在 URL 中遇到了问题
localhost,127.0.0.1我使用host.docker.internal主机名解决了该问题。
PS:不要忘记杀死所有*-dapr_1容器,以便它可以加载新配置。
| 归档时间: |
|
| 查看次数: |
2431 次 |
| 最近记录: |