Skip to content

Commit d63deed

Browse files
authored
fix: support otelcol opamp in aio build (#859)
Ref: HDX-1734
1 parent 8d534da commit d63deed

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.changeset/ten-dogs-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/api": patch
3+
---
4+
5+
fix: support otelcol opamp for aio build

docker/hyperdx/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99

1010
ARG NODE_VERSION=22.16.0
1111
ARG CLICKHOUSE_VERSION=24
12-
ARG OTEL_COLLECTOR_VERSION=0.120.0
12+
ARG OTEL_COLLECTOR_VERSION=0.126.0
13+
ARG OTEL_COLLECTOR_OPAMPSUPERVISOR_VERSION=0.126.0
1314

1415
# base #############################################################################################
1516
# == Clickhouse/Base Image ==
1617
FROM clickhouse/clickhouse-server:${CLICKHOUSE_VERSION}-alpine AS clickhouse_base
1718
# == Otel Collector Image ==
1819
FROM otel/opentelemetry-collector-contrib:${OTEL_COLLECTOR_VERSION} AS otel_collector_base
20+
FROM otel/opentelemetry-collector-opampsupervisor:${OTEL_COLLECTOR_OPAMPSUPERVISOR_VERSION} AS otel_collector_opampsupervisor_base
1921

2022
FROM node:${NODE_VERSION}-alpine AS node_base
2123

@@ -86,7 +88,8 @@ FROM scratch AS all-in-one-base
8688

8789
# Copy from clickhouse and otel collector bases
8890
COPY --from=clickhouse_base / /
89-
COPY --from=otel_collector_base /otelcol-contrib /usr/local/bin/otelcol-contrib
91+
COPY --from=otel_collector_base --chmod=755 /otelcol-contrib /otelcontribcol
92+
COPY --from=otel_collector_opampsupervisor_base --chmod=755 /usr/local/bin/opampsupervisor /usr/local/bin/opampsupervisor
9093

9194
# Copy Node.js runtime from node base
9295
COPY --from=node_base --link /usr/local/bin /usr/local/bin
@@ -100,13 +103,15 @@ COPY --from=hyperdx ./clickhouseConfig.xml /etc/clickhouse-server/config.xml
100103

101104
# Set up Otel Collector
102105
COPY --from=otel-collector ./config.yaml /etc/otelcol-contrib/config.yaml
106+
COPY --from=otel-collector ./supervisor_docker.yaml /etc/otel/supervisor.yaml
103107

104108
# Install MongoDB and other dependencies (consolidated into a single RUN command)
105109
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories && \
106110
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/community' >> /etc/apk/repositories && \
107111
apk update && \
108-
apk add --no-cache mongodb yaml-cpp=0.6.2-r2 curl && \
112+
apk add --no-cache mongodb yaml-cpp=0.6.2-r2 curl ca-certificates && \
109113
mkdir -p /data/db && \
114+
mkdir -p /etc/otel/supervisor-data && \
110115
rm -rf /var/cache/apk/*
111116

112117
ENV NODE_ENV production

docker/hyperdx/entry.local.base.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ export CLICKHOUSE_LOG_LEVEL="error"
99
# Same applies to the frontend/app
1010
export SERVER_URL="http://127.0.0.1:${HYPERDX_API_PORT:-8000}"
1111
export FRONTEND_URL="${FRONTEND_URL:-${HYPERDX_APP_URL:-http://localhost}:${HYPERDX_APP_PORT:-8080}}"
12+
export OPAMP_PORT=${HYPERDX_OPAMP_PORT:-4320}
1213

1314
# Internal Services
1415
export CLICKHOUSE_ENDPOINT="tcp://ch-server:9000?dial_timeout=10s"
1516
export MONGO_URI="mongodb://db:27017/hyperdx"
17+
export OPAMP_SERVER_URL="http://127.0.0.1:${OPAMP_PORT}"
1618

1719
export EXPRESS_SESSION_SECRET="hyperdx is cool 👋"
1820
# IS_LOCAL_APP_MODE should be set by the calling script
1921
# Default to dangerous mode if not set
2022
export IS_LOCAL_APP_MODE="${IS_LOCAL_APP_MODE}"
2123
export NEXT_TELEMETRY_DISABLED="1"
2224

23-
2425
# Simulate Docker Service DNS
2526
echo "127.0.0.1 ch-server" >> /etc/hosts
2627
echo "127.0.0.1 db" >> /etc/hosts
@@ -48,7 +49,7 @@ while ! curl -s "http://ch-server:8123" > /dev/null; do
4849
done
4950

5051
# Start Otel Collector
51-
otelcol-contrib --config /etc/otelcol-contrib/config.yaml &
52+
opampsupervisor --config /etc/otel/supervisor.yaml > /var/log/otel-collector.log 2>&1 &
5253

5354
# Start HyperDX app
5455
npx concurrently \

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"start": "node ./build/index.js",
9393
"dev": "DOTENV_CONFIG_PATH=.env.development nodemon --signal SIGTERM -e ts,json --exec 'ts-node' --transpile-only -r tsconfig-paths/register -r dotenv-expand/config -r '@hyperdx/node-opentelemetry/build/src/tracing' ./src/index.ts",
9494
"dev-task": "DOTENV_CONFIG_PATH=.env.development nodemon --signal SIGTERM -e ts,json --exec 'ts-node' --transpile-only -r tsconfig-paths/register -r dotenv-expand/config -r '@hyperdx/node-opentelemetry/build/src/tracing' ./src/tasks/index.ts",
95-
"build": "rimraf ./build && tsc && tsc-alias",
95+
"build": "rimraf ./build && tsc && tsc-alias && cp -r src/opamp/proto build/opamp/",
9696
"lint": "eslint --quiet . --ext .ts",
9797
"lint:fix": "eslint . --ext .ts --fix",
9898
"ci:lint": "yarn lint && yarn tsc --noEmit",

0 commit comments

Comments
 (0)