Move XRequestPropagator to subpath export

The current approach of (re)exporting XRequestPropagator from index.ts forces adopters to violate a key invariant around Open Telemetry Node SDK initialization:

Before any other module in your application is loaded, you must initialize the SDK.

At least one auto-instrumentation (Winston) does not work as expected as a result, and we'll presumably run into similar problems in the future.

Instead, we should isolate exports used during SDK initialization to trivially low-dependency contexts. This change proposes to do that for XRequestPropagator, by way of a new subpath export.

The existing error-prone XRequestPropagator export via helpers is left intact, but marked @deprecated.

Since it is an @experimental feature, it may also be suitable for removal immediately (i.e., a breaking change) as long as we assist adopters with migration on update. I've not gone that route for now.

Bug: T416756

Merge request reports

Loading