Skip to content

Commit

Permalink
Add otel tracing configuration in chart
Browse files Browse the repository at this point in the history
Allow the configuration of opentelemetry tracing in the charts for the
deployment `controller.otelTracing` and the daemonset `node.otelTracing`.
The service name and the endpoint that will be used by the sdk can be
configured with `otelServiceName` and `otelExporterEndpoint` for both
components.
  • Loading branch information
Fricounet committed Aug 14, 2023
1 parent 570c0e2 commit cee4afb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
9 changes: 9 additions & 0 deletions charts/aws-ebs-csi-driver/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ spec:
{{- with .Values.controller.userAgentExtra }}
- --user-agent-extra={{ . }}
{{- end }}
{{- if .Values.controller.otelTracing }}
- --enable-otel-tracing=true
{{- end}}
- --v={{ .Values.controller.logLevel }}
{{- range .Values.controller.additionalArgs }}
- {{ . }}
Expand Down Expand Up @@ -134,6 +137,12 @@ spec:
{{- with .Values.controller.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.controller.otelTracing }}
- name: OTEL_SERVICE_NAME
value: {{ .otelServiceName }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .otelExporterEndpoint }}
{{- end }}
{{- with .Values.controller.envFrom }}
envFrom:
{{- . | toYaml | nindent 12 }}
Expand Down
9 changes: 9 additions & 0 deletions charts/aws-ebs-csi-driver/templates/node-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ spec:
- --logging-format={{ . }}
{{- end }}
- --v={{ .Values.node.logLevel }}
{{- if .Values.node.otelTracing }}
- --enable-otel-tracing=true
{{- end}}
env:
- name: CSI_ENDPOINT
value: unix:/csi/csi.sock
Expand All @@ -68,6 +71,12 @@ spec:
{{- if .Values.proxy.http_proxy }}
{{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }}
{{- end }}
{{- with .Values.node.otelTracing }}
- name: OTEL_SERVICE_NAME
value: {{ .otelServiceName }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .otelExporterEndpoint }}
{{- end }}
{{- with .Values.node.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
Expand Down
17 changes: 13 additions & 4 deletions charts/aws-ebs-csi-driver/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
operator: "Exists"
{{- end }}
{{- with .Values.node.securityContext }}
securityContext:
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
Expand All @@ -64,6 +64,9 @@ spec:
- --logging-format={{ . }}
{{- end }}
- --v={{ .Values.node.logLevel }}
{{- if .Values.node.otelTracing }}
- --enable-otel-tracing=true
{{- end}}
env:
- name: CSI_ENDPOINT
value: unix:/csi/csi.sock
Expand All @@ -74,6 +77,12 @@ spec:
{{- if .Values.proxy.http_proxy }}
{{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }}
{{- end }}
{{- with .Values.node.otelTracing }}
- name: OTEL_SERVICE_NAME
value: {{ .otelServiceName }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .otelExporterEndpoint }}
{{- end }}
{{- with .Values.node.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -109,7 +118,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.node.containerSecurityContext }}
securityContext:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: node-driver-registrar
Expand Down Expand Up @@ -158,7 +167,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sidecars.nodeDriverRegistrar.securityContext }}
securityContext:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: liveness-probe
Expand All @@ -181,7 +190,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sidecars.livenessProbe.securityContext }}
securityContext:
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
Expand Down
8 changes: 8 additions & 0 deletions charts/aws-ebs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ controller:
# - name: wait
# image: busybox
# command: [ 'sh', '-c', "sleep 20" ]
# Enable opentelemetry tracing for the plugin running on the daemonset
otelTracing: {}
# otelServiceName: ebs-csi-controller
# otelExporterEndpoint: "http://localhost:4317"

node:
env: []
Expand Down Expand Up @@ -354,6 +358,10 @@ node:
containerSecurityContext:
readOnlyRootFilesystem: true
privileged: true
# Enable opentelemetry tracing for the plugin running on the daemonset
otelTracing: {}
# otelServiceName: ebs-csi-node
# otelExporterEndpoint: "http://localhost:4317"

storageClasses: []
# Add StorageClass resources like:
Expand Down

0 comments on commit cee4afb

Please sign in to comment.