mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
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:
parent
161cdcc8d0
commit
18c2b37599
3 changed files with 20 additions and 0 deletions
5
.changeset/grumpy-comics-chew.md
Normal file
5
.changeset/grumpy-comics-chew.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/otel-collector": patch
|
||||
---
|
||||
|
||||
fix: Fallback to legacy schema when CH JSON feature gate is on
|
||||
5
.changeset/smart-jeans-joke.md
Normal file
5
.changeset/smart-jeans-joke.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/otel-collector": patch
|
||||
---
|
||||
|
||||
fix: support OTEL_AGENT_FEATURE_GATE_ARG in opamp-less mode
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue