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

fix: Make the otel trace endpoint configurable #326

Merged
merged 8 commits into from
Feb 3, 2025
2 changes: 1 addition & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.24.8
version: 0.24.9
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ spec:
value: {{ toJson .Values.global.banners | quote }}
{{- if ne .Values.traceRatio 0.0 }}
- name: GORILLA_TRACER
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}"
value: {{ include "wandb.otelTracesEndpoint" . | quote }}
{{- end }}
- name: OVERFLOW_BUCKET_ADDR
value: {{ (include "wandb.bucket" . | fromYaml).url | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
value: "{{ (include "wandb.bucket" . | fromYaml).url }}"
{{- if ne .Values.traceRatio 0.0 }}
- name: GORILLA_TRACER
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}"
value: {{ include "wandb.otelTracesEndpoint" . | quote }}
{{- end }}
- name: ONLY_SERVICE
value: gorilla-executor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec:
{{- end }}
{{- if ne .Values.traceRatio 0.0 }}
- name: GORILLA_TRACER
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}"
value: {{ include "wandb.otelTracesEndpoint" . | quote }}
{{- end }}
- name: ONLY_SERVICE
value: gorilla-filestream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ spec:
{{- end }}
{{- if ne .Values.traceRatio 0.0 }}
- name: GORILLA_TRACER
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}"
value: {{ include "wandb.otelTracesEndpoint" . | quote }}
{{- end }}
- name: ONLY_SERVICE
value: gorilla-flat-run-fields-updater
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ spec:
value: "{{ (include "wandb.bucket" . | fromYaml).url }}"
{{- if ne .Values.traceRatio 0.0 }}
- name: GORILLA_TRACER
value: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.traceRatio }}"
value: {{ include "wandb.otelTracesEndpoint" . | quote }}
{{- end }}
- name: ONLY_SERVICE
value: gorilla-parquet
Expand Down
11 changes: 11 additions & 0 deletions charts/operator-wandb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return the endpoint to send otel traces to (only works when called within a subchart or traceRatio will not be present)
*/}}
{{- define "wandb.otelTracesEndpoint" -}}
{{- if .Values.global.otel.traces.host -}}
otlp+{{ .Values.global.otel.traces.proto }}://{{ .Values.global.otel.traces.host }}:{{ .Values.global.otel.traces.port }}?trace_ratio={{ default 0.0 .Values.traceRatio }}
{{- else -}}
otlp+{{ .Values.global.otel.traces.proto }}://{{ .Release.Name }}-otel-daemonset:{{ .Values.global.otel.traces.port }}?trace_ratio={{ default 0.0 .Values.traceRatio }}
{{- end -}}
{{- end -}}
3 changes: 0 additions & 3 deletions charts/operator-wandb/templates/gorilla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ data:
GORILLA_STATSD_HOST: "0.0.0.0"
{{- end }}
{{- end }}
{{- if ne .Values.app.traceRatio 0.0 }}
GORILLA_TRACER: "otlp+grpc://{{ .Release.Name }}-otel-daemonset:4317?trace_ratio={{ .Values.app.traceRatio }}"
{{- end }}
WEAVE_SERVICE: "{{ .Release.Name }}-weave:9994"
PARQUET_HOST: "http://{{ .Release.Name }}-parquet:8087"
PARQUET_ENABLED: "true"
Expand Down
10 changes: 10 additions & 0 deletions charts/operator-wandb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ global:
secret: ""
clientId: ""

otel:
traces:
host: "" # defaults to the otel-daemonset service
port: 4317 # grpc default is 4317, http default is 4318
proto: "grpc" # grpc, http

clickhouse:
install: false
host: ""
Expand Down Expand Up @@ -500,6 +506,8 @@ glue:
value: '{{ include "wandb.mysql" . | trim }}'
GORILLA_RUN_STORE:
value: '{{ include "wandb.mysql" . | trim }}'
GORILLA_TRACER:
value: '{{ include "wandb.otelTracesEndpoint" . | trim }}'
GORILLA_FILE_STREAM_STORE_ADDRESS:
value: '{{ include "wandb.fileStreamStoreProducer" . }}'
GORILLA_HISTORY_STORE:
Expand Down Expand Up @@ -671,6 +679,8 @@ api:
value: '{{ include "wandb.mysql" . | trim }}'
GORILLA_RUN_STORE:
value: '{{ include "wandb.mysql" . | trim }}'
GORILLA_TRACER:
value: '{{ include "wandb.otelTracesEndpoint" . | trim }}'
GORILLA_FILE_STREAM_STORE_ADDRESS:
value: '{{ include "wandb.fileStreamStoreProducer" . }}'
GORILLA_HISTORY_STORE:
Expand Down
Loading