Repository navigation
[HDX-5951] Start check-alerts CronJob through bin/hyperdx - #303
Conversation
…5951) On HyperDX images >= 2.22.0 (and non-semver tags) the check-alerts CronJob now runs /app/packages/api/bin/hyperdx task check-alerts, so the image picks its own self-telemetry preload. This mirrors the operator fix in DeploySentinel/hyperdx-operator#314 and is needed once ClickHouse/ClickStack#3575 (ClickStack Node SDK) ships. Older semver tags keep their previous commands.
🦋 Changeset detectedLatest commit: 6719eac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Helm template coverage
Uncovered detailscharts/clickstack/templates/NOTES.txtUncovered lines: none Uncovered branches: 37:default:fallback charts/clickstack/templates/_helpers.tplUncovered lines: 17 Uncovered branches: 111:or(1):true, 128:range:empty, 159:default:fallback, 160:or(1):true, 16:if:true, 176:if:false charts/clickstack/templates/additional-manifests.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/clickhouse/cluster.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/clickhouse/keeper.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/configmap.yamlUncovered lines: none Uncovered branches: 8:range:empty charts/clickstack/templates/hyperdx/cronjob-check-alerts.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/dashboard-configmap.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yamlUncovered lines: none Uncovered branches: 40:range:empty charts/clickstack/templates/hyperdx/deployment.yamlUncovered lines: none Uncovered branches: 117:default:fallback, 127:default:fallback, 150:if:false, 169:and(2):false, 16:with:empty, 192:default:fallback, 197:with:empty, 22:default:fallback, 38:with:empty charts/clickstack/templates/hyperdx/hpa.yamlUncovered lines: none Uncovered branches: 16:with:empty charts/clickstack/templates/hyperdx/ingress.yamlUncovered lines: none Uncovered branches: 35:if:false, 40:range:empty, 45:range:empty, 48:with:empty, 54:range:empty, 58:range:empty, 59:or(2):true, 59:or(3):true charts/clickstack/templates/hyperdx/networkpolicy.yamlUncovered lines: none Uncovered branches: 11:with:empty charts/clickstack/templates/hyperdx/pdb.yamlUncovered lines: none Uncovered branches: 10:with:empty charts/clickstack/templates/hyperdx/secret.yamlUncovered lines: none Uncovered branches: 13:range:empty, 1:or(2):true, 1:or(3):true charts/clickstack/templates/hyperdx/service.yamlUncovered lines: none Uncovered branches: 14:default:fallback, 9:with:empty charts/clickstack/templates/hyperdx/serviceaccount.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/mongodb/community.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/mongodb/password-secret.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/otel-collector/custom-config.yamlUncovered lines: none Uncovered branches: none |
Deep ReviewScope: The rendering logic is sound. The three-way conditional, the ✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (4): correctness, testing, maintainability, project-standards. Testing gaps: No test pins prerelease-suffixed semver tags (e.g. Pre-existing (not introduced by this diff): A semver-shaped-but-invalid tag like No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. |
Summary
The
check-alertsCronJob started its container withnode /app/packages/api/build/tasks/index.js check-alerts. That bypassesbin/hyperdx, the entrypoint the image itself uses inentry.prod.sh, so the task never loaded a self-telemetry preload andOTEL_SERVICE_NAME=hdx-oss-task-check-alertswas dead config.ClickHouse/ClickStack#3575 swaps the self-instrumentation SDK for
@clickhouse/clickstack-node, and the preload path moves with it. Mirroring DeploySentinel/hyperdx-operator#314, the CronJob now runs/app/packages/api/bin/hyperdx task check-alertsso the image picks its own preload and the chart stops caring where it lives.Linear: HDX-5951
Changes
templates/hyperdx/cronjob-check-alerts.yaml: the command switch now has three branches, keyed on the image tag:< 2.7.0:node /app/packages/api/tasks/index check-alerts(unchanged)>= 2.7.0, < 2.22.0:node /app/packages/api/build/tasks/index.js check-alerts(unchanged)>= 2.22.0or non-semver tag (2-beta,latest):/app/packages/api/bin/hyperdx task check-alerts(new; defaultappVersion2.39.1 takes this path)additionalArgspassthrough is preserved in every branch.tests/task-checkAlerts_test.yaml:2-betaand3.0.0cases expect the new command; added boundary tests for2.21.9,2.22.0, the default tag, andadditionalArgson the new path.Compatibility
bin/hyperdxfirst ships in HyperDX 2.22.0 (ClickHouse/ClickStack#1951) and is copied into every stage of the all-in-one image. Itexecs node so PID 1 and signal handling are unchanged. Post-#3575 the preload only starts the SDK whenHYPERDX_API_KEYorOTEL_EXPORTER_OTLP_HEADERSis set; the chart setsHYPERDX_API_KEYby default, so the task starts exporting to the chart's collector like the API pod already does.Validation
make test: 286/286make coverage: 99.85% line, 91.19% branchhelm template --set hyperdx.tasks.enabled=true --set hyperdx.tasks.checkAlerts.additionalArgs.concurrency=4renders["/app/packages/api/bin/hyperdx", "task", "check-alerts", "--concurrency", "4"]