feat: improve Skywalking and Zipkin integration (#1131)

This commit is contained in:
Se7en
2024-08-08 22:40:33 +08:00
committed by GitHub
parent dc4ddb52ee
commit fec2e9dfc9
3 changed files with 26 additions and 21 deletions

View File

@@ -97,7 +97,7 @@ higress: {{ include "controller.name" . }}
{{- end }} {{- end }}
{{- define "skywalking.enabled" -}} {{- 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 true
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -46,10 +46,6 @@
address: {{ .Values.global.tracer.lightstep.address }} address: {{ .Values.global.tracer.lightstep.address }}
# Access Token used to communicate with the Satellite pool # Access Token used to communicate with the Satellite pool
accessToken: {{ .Values.global.tracer.lightstep.accessToken }} 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" }} {{- else if eq .Values.global.proxy.tracer "datadog" }}
datadog: datadog:
# Address of the Datadog Agent # Address of the Datadog Agent
@@ -109,7 +105,14 @@ metadata:
labels: labels:
{{- include "gateway.labels" . | nindent 4 }} {{- include "gateway.labels" . | nindent 4 }}
data: 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. # Configuration file for the mesh networks to be used by the Split Horizon EDS.
meshNetworks: |- meshNetworks: |-
{{- if .Values.global.meshNetworks }} {{- if .Values.global.meshNetworks }}
@@ -170,8 +173,8 @@ data:
"endpoint": { "endpoint": {
"address": { "address": {
"socket_address": { "socket_address": {
"address": "{{ .Values.skywalking.service.address }}", "address": "{{ .Values.tracing.skywalking.service }}",
"port_value": "{{ .Values.skywalking.service.port }}" "port_value": "{{ .Values.tracing.skywalking.port }}"
} }
} }
} }

View File

@@ -178,9 +178,9 @@ global:
# Default port for Pilot agent health checks. A value of 0 will disable health checking. # Default port for Pilot agent health checks. A value of 0 will disable health checking.
statusPort: 15020 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. # 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 # 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 holdApplicationUntilProxyStarts: false
@@ -330,12 +330,8 @@ global:
maxNumberOfAnnotations: 200 maxNumberOfAnnotations: 200
# The global default max number of attributes per span. # The global default max number of attributes per span.
maxNumberOfAttributes: 200 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. # Use the Mesh Control Protocol (MCP) for configuring Istiod. Requires an MCP source.
useMCP: false useMCP: false
# Observability (o11y) configurations # Observability (o11y) configurations
@@ -668,9 +664,15 @@ pilot:
podLabels: {} podLabels: {}
# Skywalking config settings # Tracing config settings
skywalking: tracing:
enabled: false enable: false
service: sampling: 100
address: ~ timeout: 500
port: 11800 skywalking:
# access_token: ""
service: ""
port: 11800
# zipkin:
# service: ""
# port: 9411