Skip to content

chore: Add telemetry support for Helm #588

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 16, 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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions deploy/helm/secret-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 }}
1 change: 1 addition & 0 deletions deploy/helm/secret-operator/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain | quote }}
{{- end }}
{{- include "telemetry.envVars" . | nindent 12 }}
volumeMounts:
- name: csi
mountPath: /csi
Expand Down
14 changes: 14 additions & 0 deletions deploy/helm/secret-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,17 @@ secretClasses:
# The namespace that the TLS Certificate Authority is installed into.
# Defaults to the namespace where secret-op is installed.
caSecretNamespace: null

# See all available options and detailed explanations about the concept here:
# https://docs.stackable.tech/home/stable/concepts/telemetry/
telemetry:
consoleLog:
enabled: true
fileLog:
enabled: false
rotationPeriod: hourly
maxFiles: 6
otelLogExporter:
enabled: false
otelTraceExporter:
enabled: false
2 changes: 1 addition & 1 deletion nix/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.