Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/check-alerts-bin-hyperdx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

fix(clickstack): start the check-alerts CronJob through `bin/hyperdx` on HyperDX images 2.22.0 and newer, so the task loads the image's own self-telemetry preload. Images built after the switch to the ClickStack Node SDK need this. Older image tags keep their previous command.
17 changes: 14 additions & 3 deletions charts/clickstack/templates/hyperdx/cronjob-check-alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ spec:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- $tag := .Values.hyperdx.deployment.image.tag | default .Chart.AppVersion -}}
{{- if and (regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag) (semverCompare "< 2.7.0" $tag) }} # before esbuild revert
{{- $semver := regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag -}}
{{- if and $semver (semverCompare "< 2.7.0" $tag) }}
command:
- "node"
- "/app/packages/api/tasks/index"
Expand All @@ -44,15 +45,25 @@ spec:
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- else }}
command: # after esbuild revert
{{- else if and $semver (semverCompare "< 2.22.0" $tag) }}
command:
- "node"
- "/app/packages/api/build/tasks/index.js"
- "check-alerts"
{{- range $key, $value := .Values.hyperdx.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- else }}
# bin/hyperdx loads the image's own self-telemetry preload
command:
- "/app/packages/api/bin/hyperdx"
- "task"
- "check-alerts"
{{- range $key, $value := .Values.hyperdx.tasks.checkAlerts.additionalArgs }}
- "--{{ $key }}"
- "{{ $value }}"
{{- end }}
{{- end }}
envFrom:
- configMapRef:
Expand Down
56 changes: 54 additions & 2 deletions charts/clickstack/tests/task-checkAlerts_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tests:
value: hyperdx/hyperdx:2-beta
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]
value: ["/app/packages/api/bin/hyperdx", "task", "check-alerts"]
- isSubset:
path: spec.jobTemplate.spec.template.spec.containers[0].resources
content:
Expand Down Expand Up @@ -186,19 +186,71 @@ tests:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should use post-esbuild command path for version 3.0.0
- it: should use bin/hyperdx command for version 3.0.0
set:
hyperdx:
tasks:
enabled: true
deployment:
image:
tag: "3.0.0"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["/app/packages/api/bin/hyperdx", "task", "check-alerts"]

- it: should use post-esbuild command path for version 2.21.9
set:
hyperdx:
tasks:
enabled: true
deployment:
image:
tag: "2.21.9"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

- it: should use bin/hyperdx command for version 2.22.0
set:
hyperdx:
tasks:
enabled: true
deployment:
image:
tag: "2.22.0"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["/app/packages/api/bin/hyperdx", "task", "check-alerts"]

- it: should use bin/hyperdx command for the default appVersion
set:
hyperdx:
tasks:
enabled: true
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["/app/packages/api/bin/hyperdx", "task", "check-alerts"]

- it: should include additionalArgs in bin/hyperdx command
set:
hyperdx:
tasks:
enabled: true
checkAlerts:
additionalArgs:
concurrency: 6
deployment:
image:
tag: "2.39.1"
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].command
value: ["/app/packages/api/bin/hyperdx", "task", "check-alerts", "--concurrency", "6"]

- it: should not include additionalArgs when empty
set:
hyperdx:
Expand Down
Loading