Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove export * from ... usage in sdk-node package #5461

Open
trentm opened this issue Feb 12, 2025 · 0 comments
Open

remove export * from ... usage in sdk-node package #5461

trentm opened this issue Feb 12, 2025 · 0 comments

Comments

@trentm
Copy link
Contributor

trentm commented Feb 12, 2025

See #4186 where we worked through remove all other export * from ... usage in published packages. These in the sdk-node package are the last remaining ones:

export * as api from '@opentelemetry/api';
export * as contextBase from '@opentelemetry/api';
export * as core from '@opentelemetry/core';
export * as logs from '@opentelemetry/sdk-logs';
export * as metrics from '@opentelemetry/sdk-metrics';
export * as node from '@opentelemetry/sdk-trace-node';
export * as resources from '@opentelemetry/resources';
export * as tracing from '@opentelemetry/sdk-trace-base';

The original motivations for remove export * usage:

Some discussion specifically about the export * in the sdk-node package start here: #4186 (comment)

Does anyone use these re-exports?

Some anecdotal data on how common it is that these re-exports are used from the sdk-node package.

The contrib repo has three cases of using these re-exports:

metapackages/auto-instrumentations-node/src/register.ts
16:import * as opentelemetry from '@opentelemetry/sdk-node';

packages/baggage-span-processor/README.md
33:import { NodeSDK, tracing } from '@opentelemetry/sdk-node';

packages/opentelemetry-test-utils/src/test-fixtures.ts
27:import { NodeSDK, tracing } from '@opentelemetry/sdk-node';

The first one (in auto-instrumentations-node) will be removed as part of #5443 and open-telemetry/opentelemetry-js-contrib#2708).

I acknowledge the convenience of using the tracing re-export to get common classes like tracing.SimpleSpanProcessor and tracing.ConsoleSpanExporter.


An unscientific read through results from https://github.com/search?q=%22from+'%2540opentelemetry%252Fsdk-node'%22 suggests that somewhere around 10% of hits for import { ... } from '@opentelemetry/sdk-node' are using one of these re-exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant