diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 44c40824e4..40f2bcbbfa 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to experimental packages in this project will be documented ### :bug: (Bug Fix) +* fix(sdk-node): register instrumentations early [#3502](https://github.com/open-telemetry/opentelemetry-js/pull/3502) @flarna * fix: include tracestate in export [#3569](https://github.com/open-telemetry/opentelemetry-js/pull/3569) @flarna ### :books: (Refine Doc) diff --git a/experimental/packages/opentelemetry-sdk-node/src/sdk.ts b/experimental/packages/opentelemetry-sdk-node/src/sdk.ts index a3af268442..caad9b85e2 100644 --- a/experimental/packages/opentelemetry-sdk-node/src/sdk.ts +++ b/experimental/packages/opentelemetry-sdk-node/src/sdk.ts @@ -208,6 +208,10 @@ export class NodeSDK { return; } + registerInstrumentations({ + instrumentations: this._instrumentations, + }); + if (this._autoDetectResources) { await this.detectResources(); } @@ -255,10 +259,6 @@ export class NodeSDK { metrics.setGlobalMeterProvider(meterProvider); } - - registerInstrumentations({ - instrumentations: this._instrumentations, - }); } public shutdown(): Promise {