- 安装 Jaeger Operator
1kubectl create namespace observability
2kubectl create -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.52.0/jaeger-operator.yaml -n observability
若 rbac-proxy 安装失败,则修改 kube-rbac-prox 镜像地址为
10.101.7.108:80/open_source/kubebuilder/kube-rbac-proxy:v0.13.0
- 安装 Jaeger
1apiVersion: jaegertracing.io/v1
2kind: Jaeger
3metadata:
4 name: jaeger-prod
5 namespace: observability
6spec:
7 strategy: production
8 storage:
9 type: elasticsearch
10 esIndexCleaner:
11 enabled: true # turn the cron job deployment on and off
12 numberOfDays: 7 # number of days to wait before deleting a record
13 schedule: "55 23 * * *" # cron expression for it to run
14 options:
15 es:
16 server-urls: http://elasticsearch.szhems.svc:9200
17 index-prefix: dev
18 # tls:
19 # ca: /es/certificates/ca.crt
20 # secretName: jaeger-secret
21 # volumeMounts:
22 # - name: certificates
23 # mountPath: /es/certificates/
24 # readOnly: true
25 # volumes:
26 # - name: certificates
27 # secret:
28 # secretName: quickstart-es-http-certs-public
- go-zero 每个服务的配置文件下添加Telemetry配置
1Log:
2 ServiceName: platform-api
3 Level: info
4 Stat: false
5 TimeFormat: 2006-01-02 15:04:05
参考资料: