feat: add OTLP auth token support for standalone mode (#1684)

Ref: HDX-3317
This commit is contained in:
Warren Lee 2026-02-02 18:25:38 +01:00 committed by GitHub
parent 6f4c8efba0
commit c2a6193393
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/otel-collector": patch
---
feat: add OTLP auth token support for standalone mode

View file

@ -43,6 +43,7 @@ LABEL org.opencontainers.image.vendor="HyperDX" \
COPY --chown=10001:10001 ./config.yaml /etc/otelcol-contrib/config.yaml
COPY --chown=10001:10001 ./config.standalone.yaml /etc/otelcol-contrib/standalone-config.yaml
COPY --chown=10001:10001 ./config.standalone.auth.yaml /etc/otelcol-contrib/standalone-auth-config.yaml
COPY --chown=10001:10001 ./supervisor_docker.yaml.tmpl /etc/otel/supervisor.yaml.tmpl
COPY --chown=10001:10001 ./schema /etc/otel/schema
@ -61,6 +62,7 @@ LABEL org.opencontainers.image.vendor="HyperDX" \
COPY --chown=10001:10001 ./config.yaml /etc/otelcol-contrib/config.yaml
COPY --chown=10001:10001 ./config.standalone.yaml /etc/otelcol-contrib/standalone-config.yaml
COPY --chown=10001:10001 ./config.standalone.auth.yaml /etc/otelcol-contrib/standalone-auth-config.yaml
COPY --chown=10001:10001 ./supervisor_docker.yaml.tmpl /etc/otel/supervisor.yaml.tmpl
COPY --chown=10001:10001 ./schema /etc/otel/schema

View file

@ -0,0 +1,21 @@
# This configuration enables bearer token authentication for the OTLP receiver
# Only included when OTLP_AUTH_TOKEN environment variable is set
extensions:
bearertokenauth/hyperdx:
scheme: ""
tokens:
- ${env:OTLP_AUTH_TOKEN}
receivers:
otlp/hyperdx:
protocols:
grpc:
auth:
authenticator: bearertokenauth/hyperdx
http:
auth:
authenticator: bearertokenauth/hyperdx
service:
extensions: [health_check, bearertokenauth/hyperdx]

View file

@ -105,6 +105,12 @@ if [ -z "$OPAMP_SERVER_URL" ]; then
# Build collector arguments with multiple config files
COLLECTOR_ARGS="--config /etc/otelcol-contrib/config.yaml --config /etc/otelcol-contrib/standalone-config.yaml"
# Add bearer token auth config if OTLP_AUTH_TOKEN is specified (only used in standalone mode)
if [ -n "$OTLP_AUTH_TOKEN" ]; then
echo "OTLP_AUTH_TOKEN is configured, enabling bearer token authentication"
COLLECTOR_ARGS="$COLLECTOR_ARGS --config /etc/otelcol-contrib/standalone-auth-config.yaml"
fi
# Add custom config file if specified
if [ -n "$CUSTOM_OTELCOL_CONFIG_FILE" ]; then
echo "Including custom config: $CUSTOM_OTELCOL_CONFIG_FILE"