[HDX-4879] Restore inline custom OTEL collector config support#251
Conversation
Adds global.otelCollector.customConfig, restoring the otel.customConfig capability lost in the v3 migration to the official OpenTelemetry Collector subchart. When set, the config is rendered into the clickstack-otel-custom-config ConfigMap, mounted at /etc/otelcol-contrib/custom/custom.config.yaml, and exposed via the CUSTOM_OTELCOL_CONFIG_FILE env var (through the shared clickstack-config ConfigMap) so the collector image merges it on top of its built-in config in both OpAMP supervisor and standalone mode. A checksum/custom-config pod annotation rolls collector pods on change.
🦋 Changeset detectedLatest commit: b6854ee 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 |
Deep Review✅ No critical issues found. The default render (with 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (4): correctness, testing, project-standards, adversarial. Testing gaps:
|
Summary
Restores the
otel.customConfigcapability that was lost in the v3 migration to the official OpenTelemetry Collector subchart (#188), as a newglobal.otelCollector.customConfigvalue.Linear: HDX-4879
How it works
The subchart's
values.schema.jsonsetsadditionalProperties: false, so the value can't live underotel-collector:.global.*is free-form and visible to both parent templates and the subchart'stplcontexts, which enables a fully turnkey design:clickstack-otel-custom-config(templates/otel-collector/custom-config.yaml) rendered when the value is set and the collector is enabledotel-collector.extraVolumes/extraVolumeMountsinvalues.yaml— directory mount at/etc/otelcol-contrib/customwithoptional: true, so it is a no-op when unset (directory mount avoids the kubelet subPath failure mode for missing optional ConfigMaps)CUSTOM_OTELCOL_CONFIG_FILEadded to the sharedclickstack-configConfigMap (the collector already consumes it viaextraEnvsFrom; this is the only conditional env path since subchartextraEnvsis static). An explicithyperdx.config.CUSTOM_OTELCOL_CONFIG_FILEtakes precedencechecksum/custom-configpod annotation (podAnnotationsis tpl'd and map-merged in the subchart, so user annotations still merge)The collector image honors
CUSTOM_OTELCOL_CONFIG_FILEin both OpAMP supervisor mode (default) and standalone mode. Note the subchart's nativeconfig:/relay.yaml is ignored by the ClickStack image entrypoint, which is why this env-var path is required.Known limitation
If users override
otel-collector.extraVolumes/extraVolumeMounts, Helm replaces the pre-wired lists — documented invalues.yaml, the example README, and UPGRADE.md.Changes
charts/clickstack/values.yaml— newglobal.otelCollector.customConfig+ pre-wired volume/mount/checksum annotationcharts/clickstack/templates/otel-collector/custom-config.yaml— new ConfigMap templatecharts/clickstack/templates/hyperdx/configmap.yaml— conditionalCUSTOM_OTELCOL_CONFIG_FILEcharts/clickstack/tests/otel-collector-custom-config_test.yaml— rewritten from vestigial generic assertions to 9 real tests, including subchart deployment wiring assertionsdocs/UPGRADE.md— migration path for the oldotel.customConfigexamples/otel-custom-config/— worked example (validated in CI)Test plan
helm unittest charts/clickstack— 187 tests pass (9 new)helm templatediff vsmainis a behavioral no-op (only inert optional volume/mount + constant checksum annotation)otel-collector.enabled=false+ customConfig set → no ConfigMap rendered