fix: Fallback to legacy schema when CH JSON feature gate is on (#1748)

Currently users will need to add an extra flag to enable it `HYPERDX_OTEL_EXPORTER_CREATE_LEGACY_SCHEMA`=true. Ideally the JSON schema should be created if feature gate is enable `OTEL_AGENT_FEATURE_GATE_ARG='--feature-gates=clickhouse.json'`

Ref: HDX-3428
This commit is contained in:
Warren Lee 2026-02-18 17:42:44 +01:00 committed by GitHub
parent 161cdcc8d0
commit 18c2b37599
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/otel-collector": patch
---
fix: Fallback to legacy schema when CH JSON feature gate is on

View file

@ -0,0 +1,5 @@
---
"@hyperdx/otel-collector": patch
---
fix: support OTEL_AGENT_FEATURE_GATE_ARG in opamp-less mode

View file

@ -1,6 +1,11 @@
#!/bin/sh
set -e
# Fall back to legacy schema when the ClickHouse JSON feature gate is enabled
if echo "$OTEL_AGENT_FEATURE_GATE_ARG" | grep -q "clickhouse.json"; then
export HYPERDX_OTEL_EXPORTER_CREATE_LEGACY_SCHEMA=true
fi
# Run ClickHouse schema migrations if not using legacy schema creation
if [ "$HYPERDX_OTEL_EXPORTER_CREATE_LEGACY_SCHEMA" != "true" ]; then
# Run Go-based migrate tool with TLS support
@ -34,6 +39,11 @@ if [ -z "$OPAMP_SERVER_URL" ]; then
COLLECTOR_ARGS="$COLLECTOR_ARGS --config $CUSTOM_OTELCOL_CONFIG_FILE"
fi
# Pass feature gates to the collector in standalone mode
if [ -n "$OTEL_AGENT_FEATURE_GATE_ARG" ]; then
COLLECTOR_ARGS="$COLLECTOR_ARGS $OTEL_AGENT_FEATURE_GATE_ARG"
fi
# Execute collector directly
exec /otelcontribcol $COLLECTOR_ARGS
else