Skip to content

feat: port built-in OpenTelemetry tracing from nodejs/node - #1

Closed
bengl wants to merge 2 commits into
mainfrom
bengl/otel-port
Closed

bengl wants to merge 2 commits into
mainfrom
bengl/otel-port

Conversation

@bengl

@bengl bengl commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Ports the tracing subsystem from nodejs/node#66587 into this package as a standalone library.

The core integration points are intentionally left out: no NODE_OTEL* environment variables and no --experimental-otel flag. All configuration goes through a single exported init(options) API, with a serviceName option replacing the OTEL_SERVICE_NAME environment read. isActive() and flush() are also exported.

One deliberate divergence: init() rejects endpoint protocols other than http: and https: up front. The core version only warns at export time, which is fine for startup-time activation from an environment variable, but a programmatic API that throws on invalid options should not accept an endpoint it can never export to.

Includes the ported test suite (48 tests, node --test, all green), a benchmark of the HTTP hot path, and README docs for the init() options, instrumented operations, and W3C trace context propagation.

Refs: nodejs/node#66587

bengl added 2 commits October 21, 2026 16:01
Ports the tracing subsystem from nodejs/node#66587 into this package,
minus the core integration points: no NODE_OTEL* environment variables
and no --experimental-otel flag. Configuration is a single exported
init(options) API instead, with a serviceName option replacing the
OTEL_SERVICE_NAME environment read. Also exports isActive() and flush().

One deliberate divergence from the upstream implementation: init()
rejects endpoint protocols other than http: and https: up front. The
core version only warns at export time, which is fine when activation
happens once at startup from an environment variable, but a programmatic
API that throws on invalid options should not silently accept an
endpoint it can never export to.

Includes the ported test suite (node --test, 48 tests), a benchmark of
the HTTP hot path, and README documentation of the init() options,
instrumented operations, and W3C trace context propagation.

Refs: nodejs/node#66587
Signed-off-by: Bryan English <bryan.english@datadoghq.com>
@bengl bengl closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant