istio-opentracing链路追踪方案 (2)

这个官方的jaeger是支持发送到kafka,但由于jaeger会生成3个index(jaeger-span,jaeger-service,jager-dependencies),而kafka发送到ES时,要区分有点麻烦。暂时先直接发送到ES。

jaeger-query

这个配置只需将查询地址改为ES的地址。

jaeger-query的dependencies服务生成图需要自己配置spark-dependencies

线上例子

jaeger-collector的ES配置参数可通过下面来查看,jaeger-query的参数也是一样的

docker run \ -e SPAN_STORAGE_TYPE=elasticsearch \ jaegertracing/jaeger-collector:1.8 \ --help

k8s jaeger的configmap

apiVersion: v1 kind: ConfigMap metadata: name: jaeger-configuration namespace: istio-system labels: app: jaeger jaeger-infra: configuration data: span-storage-type: elasticsearch collector: | es: server-urls: :9200,:9200 index-prefix: online-opentracing collector: zipkin: http-port: 9411 query: | es: server-urls: :9200,:9200 index-prefix: online-opentracing

k8s jaeger-collector和jaeger-query

apiVersion: v1 kind: List items: - apiVersion: extensions/v1beta1 kind: Deployment metadata: name: jaeger-collector namespace: istio-system labels: app: jaeger jaeger-infra: collector-deployment spec: replicas: 3 strategy: type: Recreate template: metadata: labels: app: jaeger jaeger-infra: collector-pod annotations: prometheus.io/scrape: "true" prometheus.io/port: "14268" spec: containers: - image: jaegertracing/jaeger-collector:1.8.2 name: jaeger-collector args: ["--config-file=http://www.likecs.com/conf/collector.yaml"] ports: - containerPort: 14267 protocol: TCP - containerPort: 14268 protocol: TCP - containerPort: 9411 protocol: TCP readinessProbe: httpGet: path: "http://www.likecs.com/" port: 14269 volumeMounts: - name: jaeger-configuration-volume mountPath: /conf env: - name: SPAN_STORAGE_TYPE valueFrom: configMapKeyRef: name: jaeger-configuration key: span-storage-type volumes: - configMap: name: jaeger-configuration items: - key: collector path: collector.yaml name: jaeger-configuration-volume - apiVersion: v1 kind: Service metadata: name: jaeger-collector namespace: istio-system labels: app: jaeger jaeger-infra: collector-service spec: ports: - name: jaeger-collector-tchannel port: 14267 protocol: TCP targetPort: 14267 - name: jaeger-collector-http port: 14268 protocol: TCP targetPort: 14268 - name: jaeger-collector-zipkin port: 9411 protocol: TCP targetPort: 9411 selector: jaeger-infra: collector-pod type: ClusterIP - apiVersion: v1 kind: Service metadata: name: zipkin namespace: istio-system labels: app: jaeger jaeger-infra: zipkin-service spec: ports: - name: jaeger-collector-zipkin port: 9411 protocol: TCP targetPort: 9411 selector: jaeger-infra: collector-pod type: ClusterIP - apiVersion: extensions/v1beta1 kind: Deployment metadata: name: jaeger-query namespace: istio-system labels: app: jaeger jaeger-infra: query-deployment spec: replicas: 1 strategy: type: Recreate template: metadata: labels: app: jaeger jaeger-infra: query-pod annotations: prometheus.io/scrape: "true" prometheus.io/port: "16686" spec: containers: - image: jaegertracing/jaeger-query:1.8.2 name: jaeger-query args: ["--config-file=http://www.likecs.com/conf/query.yaml"] ports: - containerPort: 16686 protocol: TCP readinessProbe: httpGet: path: "http://www.likecs.com/" port: 16687 volumeMounts: - name: jaeger-configuration-volume mountPath: /conf env: - name: SPAN_STORAGE_TYPE valueFrom: configMapKeyRef: name: jaeger-configuration key: span-storage-type volumes: - configMap: name: jaeger-configuration items: - key: query path: query.yaml name: jaeger-configuration-volume - apiVersion: v1 kind: Service metadata: name: jaeger-query namespace: istio-system labels: app: jaeger jaeger-infra: query-service spec: type: NodePort ports: - name: jaeger-query port: 80 protocol: TCP targetPort: 16686 nodePort: 32686 selector: jaeger-infra: query-pod

参考文档:

https://istio.io/docs/tasks/telemetry/distributed-tracing/

https://www.jianshu.com/p/5a1422b190a2

https://www.jaegertracing.io/docs/1.8/

https://github.com/jaegertracing/jaeger-kubernetes

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwpjpy.html