操作方法: 为分布式跟踪安装 Zipkin
For self hosted mode, on running :
- The following YAML file is created by default in
$HOME/.dapr/config.yaml
(on Linux/Mac) or%USERPROFILE%\.dapr\config.yaml
(on Windows) and it is referenced by default ondapr run
calls unless otherwise overridden `:
- config.yaml
- The openzipkin/zipkin docker container is launched on running
dapr init
or it can be launched with the following code.
Launch Zipkin using Docker:
- The applications launched with
dapr run
by default reference the config file in$HOME/.dapr/config.yaml
or and can be overridden with the Dapr CLI using the--config
param:
dapr run --app-id mynode --app-port 3000 node app.js
To view traces, in your browser go to and you will see the Zipkin UI.
First, deploy Zipkin:
Create a Kubernetes service for the Zipkin pod:
kubectl expose deployment zipkin --type ClusterIP --port 9411
接下来,在本地创建以下YAML文件:
- tracing.yaml configuration
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: tracing
tracing:
samplingRate: "1"
zipkin:
endpointAddress: "http://zipkin.default.svc.cluster.local:9411/api/v2/spans"
为了启用您的 Dapr sidecar 的配置,请在您的pod spec模板中添加以下注释:
annotations:
dapr.io/config: "tracing"
就这么简单! Your sidecar is now configured to send traces to Zipkin.
To view traces, connect to the Zipkin service and open the UI: