Problem
Currently, the HyperDX Node SDK reads the OTLP endpoint exclusively from environment variables (OTEL_EXPORTER_OTLP_ENDPOINT). This works well for simple setups, but becomes problematic when running multiple OTEL collectors in the same environment.
In my team's case, we use multiple OTEL collectors and need to send telemetry from HyperDX to a different endpoint than our other instrumentation. Since OTEL_EXPORTER_OTLP_ENDPOINT is already in use, and the SDK defaults to https://in-otel.hyperdx.io/ when not set, there's no way to programmatically override the endpoint.
Proposed Solution
So, I've added an optional endpoint config option to init() / initSDK():
HyperDX.init({service: 'my-app', apiKey: process.env.HYPERDX_API_KEY, url: 'http://my-otel-collector:4318',});
Gives users explicit control over where telemetry is sent. Created PR #209 to address this issue.