Skip to content
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

Extract OTEL parsing to configMap to allow consistent handling of env #719

Merged
merged 3 commits into from
Nov 18, 2024
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
13 changes: 13 additions & 0 deletions helm/blueapi/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@ metadata:
data:
config.yaml: |-
{{- toYaml .Values.worker | nindent 4 }}

---

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "blueapi.fullname" . }}-otel-config
data:
{{- if .Values.tracing.otlp.enabled | default false }}
OTLP_EXPORT_ENABLED: "true"
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: {{ .Values.tracing.otlp.protocol | default "http/protobuf" }}
OTEL_EXPORTER_OTLP_ENDPOINT: {{ required "OTLP export enabled but server address not set" .Values.tracing.otlp.server.host }}:{{ .Values.tracing.otlp.server.port | default 4318 }}
{{ end }}
3 changes: 3 additions & 0 deletions helm/blueapi/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ spec:
- "-c"
- "/config/config.yaml"
- "serve"
envFrom:
- configMapRef:
name: {{ include "blueapi.fullname" . }}-otel-config
env:
{{- toYaml .Values.extraEnvVars | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
15 changes: 5 additions & 10 deletions helm/blueapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ listener:
resources: {}

# Additional envVars to mount to the pod as a String
extraEnvVars: |
- name: OTLP_EXPORT_ENABLED
value: {{ .Values.tracing.otlp.export_enabled }}
- name: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
value: {{ .Values.tracing.otlp.protocol }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ .Values.tracing.otlp.host }}:{{ .Values.tracing.otlp.port }}"
extraEnvVars: []
# - name: RABBITMQ_PASSWORD
# valueFrom:
# secretKeyRef:
Expand All @@ -91,10 +85,11 @@ extraEnvVars: |

tracing:
otlp:
export_enabled: false
enabled: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this doing anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just me being a hater on how clunky the key name is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I agree with that, but is that key actually used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{ if .Values.tracing.otlp.enabled | default false }}

It is the condition that enables filling the ConfigMap.

protocol: http/protobuf
host: https://daq-services-jaeger # replace with central instance
port: 4318
server:
host: https://daq-services-jaeger # replace with central instance
port: 4318

# Config for the worker goes here, will be mounted into a config file
worker:
Expand Down
Loading