Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions .changeset/tall-trams-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": minor
---

Supports passing additional arguments to the check-alerts task. This allows setting the concurrency and sourceTimeoutMs through helm.
18 changes: 16 additions & 2 deletions charts/clickstack/templates/cronjobs/task-checkAlerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,23 @@ spec:
imagePullPolicy: {{ .Values.hyperdx.image.pullPolicy }}
{{- $tag := .Values.hyperdx.image.tag | default .Chart.AppVersion -}}
{{- if and (regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag) (semverCompare "< 2.7.0" $tag) }} # before esbuild revert
command: ["node", "/app/packages/api/tasks/index", "check-alerts"]
command:
- "node"
- "/app/packages/api/tasks/index"
- "check-alerts"
{{- range $key, $value := .Values.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- else }}
command: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"] # after esbuild revert
command: # after esbuild revert
- "node"
- "/app/packages/api/build/tasks/index.js"
- "check-alerts"
{{- range $key, $value := .Values.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- end }}
envFrom:
- configMapRef:
Expand Down
60 changes: 60 additions & 0 deletions charts/clickstack/tests/task-checkAlerts_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,63 @@ tests:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should not include additionalArgs when empty
set:
tasks:
enabled: true
checkAlerts:
additionalArgs: {}
hyperdx:
image:
tag: "2.8.0"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should include additionalArgs with -- prefix in command
set:
tasks:
enabled: true
checkAlerts:
additionalArgs:
concurrency: 6
sourceTimeoutMs: 90000
hyperdx:
image:
tag: "2.8.0"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--concurrency"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "6"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--sourceTimeoutMs"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "90000"

- it: should include additionalArgs in pre-esbuild command path
set:
tasks:
enabled: true
checkAlerts:
additionalArgs:
concurrency: 4
hyperdx:
image:
tag: "2.6.0"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "/app/packages/api/tasks/index"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "--concurrency"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].command
content: "4"
11 changes: 11 additions & 0 deletions charts/clickstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,17 @@ tasks:
enabled: false
checkAlerts:
schedule: "*/1 * * * *" # Runs every 1 minute

additionalArgs:
{}
# Additional command line arguments can be supplied to the check-alerts
# task by defining the param as a key/value pair. These are passed to the
# task without validation in the helm chart.
#
# Examples:
# concurrency: 6
# sourceTimeoutMs: 90000

resources:
limits:
cpu: 200m
Expand Down
Loading