Skip to content

Commit dc7801f

Browse files
committed
Disable health tracing and endpoints during debug
1 parent 31e8a2d commit dc7801f

5 files changed

Lines changed: 20 additions & 2 deletions

File tree

helm/blueapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ A Helm chart deploying a worker pod that runs Bluesky plans
4444
| serviceAccount.name | string | `""` | |
4545
| startupProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/healthz","port":"http"},"periodSeconds":10}` | A more lenient livenessProbe to allow the service to start fully. This is automatically disabled when in debug mode. |
4646
| tolerations | list | `[]` | May be required to run on specific nodes (e.g. the control machine) |
47-
| tracing | object | `{"otlp":{"enabled":false,"protocol":"http/protobuf","server":{"host":"http://opentelemetry-collector.tracing","port":4318}}}` | Configure tracing: opentelemetry-collector.tracing should be available in all Diamond clusters |
47+
| tracing | object | `{"fastapi":{"excludedURLs":"/healthz"},"otlp":{"enabled":false,"protocol":"http/protobuf","server":{"host":"http://opentelemetry-collector.tracing","port":4318}}}` | Exclude health probe requests from tracing by default to prevent spamming |
4848
| volumeMounts | list | `[{"mountPath":"/config","name":"worker-config","readOnly":true}]` | Additional volumeMounts on the output StatefulSet definition. Define how volumes are mounted to the container referenced by using the same name. |
4949
| volumes | list | `[]` | Additional volumes on the output StatefulSet definition. Define volumes from e.g. Secrets, ConfigMaps or the Filesystem |
5050
| worker | object | `{"api":{"url":"http://0.0.0.0:8000/"},"env":{"sources":[{"kind":"planFunctions","module":"dodal.plans"},{"kind":"planFunctions","module":"dodal.plan_stubs.wrapped"}]},"logging":{"graylog":{"enabled":false,"url":"tcp://graylog-log-target.diamond.ac.uk:12231/"},"level":"INFO"},"scratch":{"repositories":[],"root":"/workspace"},"stomp":{"auth":{"password":"guest","username":"guest"},"enabled":false,"url":"tcp://rabbitmq:61613/"}}` | Config for the worker goes here, will be mounted into a config file |

helm/blueapi/templates/configmap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ data:
1919
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 }}
2020
{{ end }}
2121

22+
OTEL_PYTHON_FASTAPI_EXCLUDED_URLS: {{ .Values.tracing.fastapi.excludedURLs | default "" }}
23+
2224
---
2325

2426
{{- if .Values.initContainer.enabled }}

helm/blueapi/templates/statefulset.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ spec:
182182
- "true"
183183
- "-m"
184184
- "blueapi"
185-
{{- end }}
185+
{{- else }}
186186
{{- with .Values.livenessProbe }}
187187
livenessProbe:
188188
{{- toYaml . | nindent 12 }}
@@ -195,12 +195,17 @@ spec:
195195
startupProbe:
196196
{{- toYaml . | nindent 12 }}
197197
{{- end }}
198+
{{- end }}
198199
envFrom:
199200
- configMapRef:
200201
name: {{ include "blueapi.fullname" . }}-otel-config
201202
env:
202203
- name: UV_CACHE_DIR
203204
value: {{ (.Values.worker.scratch).root }}/.uv-cache
205+
{{- if .Values.debug.enabled }}
206+
- name: DEBUG_MODE
207+
value: ON
208+
{{- end }}
204209
{{- if .Values.extraEnvVars }}
205210
{{- toYaml .Values.extraEnvVars | nindent 12 }}
206211
{{- end }}

helm/blueapi/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@
296296
"description": "Configure tracing: opentelemetry-collector.tracing should be available in all Diamond clusters",
297297
"type": "object",
298298
"properties": {
299+
"fastapi": {
300+
"type": "object",
301+
"properties": {
302+
"excludedURLs": {
303+
"type": "string"
304+
}
305+
}
306+
},
299307
"otlp": {
300308
"type": "object",
301309
"properties": {

helm/blueapi/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,16 @@ extraEnvVars: []
163163
# key: tiled_api_key
164164

165165
# -- Configure tracing: opentelemetry-collector.tracing should be available in all Diamond clusters
166+
# -- Exclude health probe requests from tracing by default to prevent spamming
166167
tracing:
167168
otlp:
168169
enabled: false
169170
protocol: http/protobuf
170171
server:
171172
host: http://opentelemetry-collector.tracing
172173
port: 4318
174+
fastapi:
175+
excludedURLs: "/healthz"
173176

174177
# @schema $ref: config_schema.json
175178
# -- Config for the worker goes here, will be mounted into a config file

0 commit comments

Comments
 (0)