Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/deep-years-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/app': patch
---

Support per-signal OTLP exporter endpoints for Hyperdx internal telemetry
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ services:
SERVER_URL: http://127.0.0.1:${HYPERDX_API_PORT}
OPAMP_PORT: ${HYPERDX_OPAMP_PORT}
OTEL_EXPORTER_OTLP_ENDPOINT: 'http://otel-collector:4318'
# Per-signal OTLP endpoints (override OTEL_EXPORTER_OTLP_ENDPOINT for individual signals)
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://otel-collector:4318/v1/traces'
# OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'http://otel-collector:4318/v1/metrics'
# OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: 'http://otel-collector:4318/v1/logs'
OTEL_SERVICE_NAME: 'hdx-oss-app'
USAGE_STATS_ENABLED: ${USAGE_STATS_ENABLED:-true}
DEFAULT_CONNECTIONS:
Expand Down
4 changes: 4 additions & 0 deletions packages/api/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ NODE_ENV=development
OTEL_SERVICE_NAME="hdx-oss-dev-api"
OTEL_RESOURCE_ATTRIBUTES="service.version=dev"
OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:${HDX_DEV_OTEL_HTTP_PORT}"
# Per-signal OTLP endpoints (override the base endpoint for individual signals)
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=
# OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=
# OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=
PORT=${HYPERDX_API_PORT}
OPAMP_PORT=${HYPERDX_OPAMP_PORT}
REDIS_URL=redis://localhost:6379
Expand Down
6 changes: 5 additions & 1 deletion packages/app/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ PORT=${HYPERDX_APP_PORT}
NODE_OPTIONS="--max-http-header-size=131072"
NEXT_PUBLIC_HYPERDX_BASE_PATH=
NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:${HDX_DEV_OTEL_HTTP_PORT:-4318}"
NEXT_PUBLIC_IS_DASHBOARD_LINKING_ENABLED=true
NEXT_PUBLIC_IS_DASHBOARD_LINKING_ENABLED=true
# Per-signal OTLP endpoints (override the base endpoint for individual signals)
# NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=
# NEXT_PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=
# NEXT_PUBLIC_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=
6 changes: 6 additions & 0 deletions packages/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ COPY --from=common-utils-builder /app/packages/common-utils ./packages/common-ut
# Expose custom env variables to the browser (needs NEXT_PUBLIC_ prefix)
# doc: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
ARG OTEL_EXPORTER_OTLP_ENDPOINT
ARG OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
ARG OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
ARG OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
ARG OTEL_SERVICE_NAME
ARG IS_LOCAL_MODE
ENV NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT $OTEL_EXPORTER_OTLP_ENDPOINT
ENV NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT $OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
ENV NEXT_PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT $OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
ENV NEXT_PUBLIC_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT $OTEL_EXPORTER_OTLP_LOGS_ENDPOINT
ENV NEXT_PUBLIC_OTEL_SERVICE_NAME $OTEL_SERVICE_NAME
ENV NEXT_PUBLIC_IS_LOCAL_MODE $IS_LOCAL_MODE

Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@hookform/resolvers": "^3.9.0",
"@hyperdx/browser": "^0.22.0",
"@hyperdx/browser": "^0.22.1",
"@hyperdx/common-utils": "^0.18.1",
"@hyperdx/node-opentelemetry": "^0.9.0",
"@mantine/core": "^9.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export default function MyApp({ Component, pageProps }: AppPropsWithLayout) {
service: _jsonData.serviceName,
// tracePropagationTargets: [new RegExp(hostname ?? 'localhost', 'i')],
url: _jsonData.collectorUrl,
tracesUrl: _jsonData.collectorTracesUrl,
logsUrl: _jsonData.collectorLogsUrl,
});
} else {
console.warn('No API key found to enable OTEL exporter');
Expand Down
6 changes: 6 additions & 0 deletions packages/app/pages/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
HDX_API_KEY,
HDX_COLLECTOR_URL,
HDX_EXPORTER_ENABLED,
HDX_LOGS_COLLECTOR_URL,
HDX_METRICS_COLLECTOR_URL,
HDX_SERVICE_NAME,
HDX_TRACES_COLLECTOR_URL,
} from '@/config';
import type { NextApiConfigResponseData } from '@/types';

Expand All @@ -15,6 +18,9 @@ export default function handler(
res.status(200).json({
apiKey: HDX_EXPORTER_ENABLED ? HDX_API_KEY : undefined,
collectorUrl: HDX_COLLECTOR_URL,
collectorTracesUrl: HDX_TRACES_COLLECTOR_URL,
collectorMetricsUrl: HDX_METRICS_COLLECTOR_URL,
collectorLogsUrl: HDX_LOGS_COLLECTOR_URL,
serviceName: HDX_SERVICE_NAME,
appVersion: process.env.NEXT_PUBLIC_APP_VERSION,
});
Expand Down
9 changes: 9 additions & 0 deletions packages/app/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ export const HDX_COLLECTOR_URL =
process.env.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT ??
process.env.OTEL_EXPORTER_OTLP_ENDPOINT ??
'http://localhost:4318';
export const HDX_TRACES_COLLECTOR_URL =
process.env.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ??
process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;
export const HDX_METRICS_COLLECTOR_URL =
process.env.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ??
process.env.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT;
export const HDX_LOGS_COLLECTOR_URL =
process.env.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT ??
process.env.OTEL_EXPORTER_OTLP_LOGS_ENDPOINT;
export const IS_DEV = NODE_ENV === 'development';

export const IS_OSS = process.env.NEXT_PUBLIC_IS_OSS ?? 'true' === 'true';
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export enum KubePhase {
export type NextApiConfigResponseData = {
apiKey?: string;
collectorUrl: string;
collectorTracesUrl?: string;
collectorMetricsUrl?: string;
collectorLogsUrl?: string;
serviceName: string;
appVersion?: string;
};
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4416,7 +4416,7 @@ __metadata:
"@eslint-react/eslint-plugin": "npm:^3.0.0"
"@eslint/compat": "npm:^2.0.0"
"@hookform/resolvers": "npm:^3.9.0"
"@hyperdx/browser": "npm:^0.22.0"
"@hyperdx/browser": "npm:^0.22.1"
"@hyperdx/common-utils": "npm:^0.18.1"
"@hyperdx/node-opentelemetry": "npm:^0.9.0"
"@jedmao/location": "npm:^3.0.0"
Expand Down Expand Up @@ -4531,13 +4531,13 @@ __metadata:
languageName: unknown
linkType: soft

"@hyperdx/browser@npm:^0.22.0":
version: 0.22.0
resolution: "@hyperdx/browser@npm:0.22.0"
"@hyperdx/browser@npm:^0.22.1":
version: 0.22.1
resolution: "@hyperdx/browser@npm:0.22.1"
dependencies:
"@hyperdx/otel-web": "npm:0.16.3"
"@hyperdx/otel-web": "npm:0.16.4"
"@hyperdx/otel-web-session-recorder": "npm:0.16.2"
checksum: 10c0/b1ee76797344f305033802abb2a755cdcfcd1f7ea2beb58d5bb4deb192b850772b4f7cbdb0903967fbf3ab2bb95e3e700280e61606e306edfd24011cdb93490a
checksum: 10c0/60a53e056e41fa74061c8d4d6e1a083b8daeb8ac5995d57c44146fd7e2adc16cf3e070514ce31439fc8f317018e2e773eee34af435c247d84467509f149dde86
languageName: node
linkType: hard

Expand Down Expand Up @@ -4712,9 +4712,9 @@ __metadata:
languageName: node
linkType: hard

"@hyperdx/otel-web@npm:0.16.3":
version: 0.16.3
resolution: "@hyperdx/otel-web@npm:0.16.3"
"@hyperdx/otel-web@npm:0.16.4":
version: 0.16.4
resolution: "@hyperdx/otel-web@npm:0.16.4"
dependencies:
"@babel/runtime": "npm:^7.21.0"
"@hyperdx/instrumentation-exception": "npm:^0.1.0"
Expand All @@ -4731,10 +4731,10 @@ __metadata:
"@opentelemetry/sdk-trace-web": "npm:~1.24.1"
"@opentelemetry/semantic-conventions": "npm:^1.24.1"
json-stringify-safe: "npm:^5.0.1"
lodash: "npm:^4.17.21"
lodash: "npm:^4.17.23"
shimmer: "npm:^1.2.1"
web-vitals: "npm:^3.3.2"
checksum: 10c0/29cc6fd0d2d2037e251846672eba0529f7a28301f45009586b99fe9e2d9235059574f1de0ed209a4cab69a9942eef42cbd1e9bc00bb29d676b9f12f33c1d29c7
checksum: 10c0/fe549fec7e4955254a973c9dd2834968b39958984a8d619f18216c71a95484e28b593a2e264819bd22fc3922f75ff6960779b6d02e51fd7e42a9a6926f892141
languageName: node
linkType: hard

Expand Down
Loading