Skip to content

Add programmatic url configuration option to node-opentelemetry package #210

@pcga11

Description

@pcga11

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions