From fec2e9dfc9571f27e1d97aa4590de97ff27e8235 Mon Sep 17 00:00:00 2001 From: Se7en Date: Thu, 8 Aug 2024 22:40:33 +0800 Subject: [PATCH] feat: improve Skywalking and Zipkin integration (#1131) --- helm/core/templates/_helpers.tpl | 2 +- helm/core/templates/configmap.yaml | 17 ++++++++++------- helm/core/values.yaml | 28 +++++++++++++++------------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/helm/core/templates/_helpers.tpl b/helm/core/templates/_helpers.tpl index 392fd04ef..752133f4b 100644 --- a/helm/core/templates/_helpers.tpl +++ b/helm/core/templates/_helpers.tpl @@ -97,7 +97,7 @@ higress: {{ include "controller.name" . }} {{- end }} {{- define "skywalking.enabled" -}} -{{- if and .Values.skywalking.enabled .Values.skywalking.service.address }} +{{- if and .Values.tracing.enable (hasKey .Values.tracing "skywalking") .Values.tracing.skywalking.service }} true {{- end }} {{- end }} diff --git a/helm/core/templates/configmap.yaml b/helm/core/templates/configmap.yaml index 53b036fc8..6623dd8dc 100644 --- a/helm/core/templates/configmap.yaml +++ b/helm/core/templates/configmap.yaml @@ -46,10 +46,6 @@ address: {{ .Values.global.tracer.lightstep.address }} # Access Token used to communicate with the Satellite pool accessToken: {{ .Values.global.tracer.lightstep.accessToken }} - {{- else if eq .Values.global.proxy.tracer "zipkin" }} - zipkin: - # Address of the Zipkin collector - address: {{ .Values.global.tracer.zipkin.address | default (print "zipkin." .Release.Namespace ":9411") }} {{- else if eq .Values.global.proxy.tracer "datadog" }} datadog: # Address of the Datadog Agent @@ -109,7 +105,14 @@ metadata: labels: {{- include "gateway.labels" . | nindent 4 }} data: - + higress: |- + {{- $existingConfig := lookup "v1" "ConfigMap" .Release.Namespace "higress-config" }} + {{- $existingData := index $existingConfig.data "higress" | default "{}" | fromYaml }} + {{- $newData := dict }} + {{- if .Values.tracing.enable }} + {{- $_ := set $newData "tracing" .Values.tracing }} + {{- end }} + {{- toYaml (merge $existingData $newData) | nindent 4 }} # Configuration file for the mesh networks to be used by the Split Horizon EDS. meshNetworks: |- {{- if .Values.global.meshNetworks }} @@ -170,8 +173,8 @@ data: "endpoint": { "address": { "socket_address": { - "address": "{{ .Values.skywalking.service.address }}", - "port_value": "{{ .Values.skywalking.service.port }}" + "address": "{{ .Values.tracing.skywalking.service }}", + "port_value": "{{ .Values.tracing.skywalking.port }}" } } } diff --git a/helm/core/values.yaml b/helm/core/values.yaml index f89110d8b..2df6db87c 100644 --- a/helm/core/values.yaml +++ b/helm/core/values.yaml @@ -178,9 +178,9 @@ global: # Default port for Pilot agent health checks. A value of 0 will disable health checking. statusPort: 15020 - # Specify which tracer to use. One of: zipkin, lightstep, datadog, stackdriver. + # Specify which tracer to use. One of: lightstep, datadog, stackdriver. # If using stackdriver tracer outside GCP, set env GOOGLE_APPLICATION_CREDENTIALS to the GCP credential file. - tracer: "zipkin" + tracer: "" # Controls if sidecar is injected at the front of the container list and blocks the start of the other containers until the proxy is ready holdApplicationUntilProxyStarts: false @@ -330,12 +330,8 @@ global: maxNumberOfAnnotations: 200 # The global default max number of attributes per span. maxNumberOfAttributes: 200 - zipkin: - # Host:Port for reporting trace data in zipkin format. If not specified, will default to - # zipkin service (port 9411) in the same namespace as the other istio components. - address: "" - # Use the Mesh Control Protocol (MCP) for configuring Istiod. Requires an MCP source. + useMCP: false # Observability (o11y) configurations @@ -668,9 +664,15 @@ pilot: podLabels: {} -# Skywalking config settings -skywalking: - enabled: false - service: - address: ~ - port: 11800 +# Tracing config settings +tracing: + enable: false + sampling: 100 + timeout: 500 + skywalking: + # access_token: "" + service: "" + port: 11800 + # zipkin: + # service: "" + # port: 9411