Skip to content

chore(template): Add Helm helper for telemetry env vars #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions template/deploy/helm/[[operator]]/templates/_telemetry.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{/*
Create a list of telemetry related env vars.
*/}}
{{- define "telemetry.envVars" -}}
{{- with .Values.telemetry }}
{{- if not .consoleLog.enabled }}
- name: CONSOLE_LOG_DISABLED
value: "true"
{{- end }}
{{- if .consoleLog.level }}
- name: CONSOLE_LOG_LEVEL
value: {{ .consoleLog.level }}
{{ end }}
{{- if .consoleLog.format }}
- name: CONSOLE_LOG_FORMAT
value: {{ .consoleLog.format }}
{{ end }}
{{- if .fileLog.enabled }}
- name: FILE_LOG_DIRECTORY
value: /stackable/logs/{{ include "operator.appname" $ }}
{{- end }}
{{- if .fileLog.level }}
- name: FILE_LOG_LEVEL
value: {{ .fileLog.level }}
{{- end }}
{{- if .fileLog.rotationPeriod }}
- name: FILE_LOG_ROTATION_PERIOD
value: {{ .fileLog.rotationPeriod }}
{{- end }}
{{- if .fileLog.maxFiles }}
- name: FILE_LOG_MAX_FILES
value: {{ .fileLog.maxFiles }}
{{- end }}
{{- if .otelLogExporter.enabled }}
- name: OTEL_LOG_EXPORTER_ENABLED
value: "true"
{{- end }}
{{- if .otelLogExporter.level }}
- name: OTEL_LOG_EXPORTER_LEVEL
value: {{ .otelLogExporter.level }}
{{- end }}
{{- if .otelLogExporter.endpoint }}
- name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
value: {{ .otelLogExporter.endpoint }}
{{- end }}
{{- if .otelTraceExporter.enabled }}
- name: OTEL_TRACE_EXPORTER_ENABLED
value: "true"
{{- end }}
{{- if .otelTraceExporter.level }}
- name: OTEL_TRACE_EXPORTER_LEVEL
value: {{ .otelTraceExporter.level }}
{{- end }}
{{- if .otelTraceExporter.endpoint }}
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
value: {{ .otelTraceExporter.endpoint }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ spec:
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain | quote }}
{{- end }}
{{- include "telemetry.envVars" . | nindent 12 }}
{[% if operator.product_string in ['kafka'] %}]
- name: KAFKA_BROKER_CLUSTERROLE
value: {{ include "operator.fullname" . }}-kafka-broker-clusterrole
Expand Down