Skip to content

Commit a90c558

Browse files
Flarnadyladan
andauthored
fix(sdk-node): register instrumentations early (#3502)
* fix(sdk-node): register instrumentations early Register instrumentations as first step in start() before it gets async to ensure that modules required during async resource detection get instrumented. * Update experimental/CHANGELOG.md --------- Co-authored-by: Daniel Dyla <[email protected]>
1 parent 5b070b8 commit a90c558

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

experimental/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to experimental packages in this project will be documented
1010

1111
### :bug: (Bug Fix)
1212

13+
* fix(sdk-node): register instrumentations early [#3502](https://github.com/open-telemetry/opentelemetry-js/pull/3502) @flarna
1314
* fix: include tracestate in export [#3569](https://github.com/open-telemetry/opentelemetry-js/pull/3569) @flarna
1415

1516
### :books: (Refine Doc)

experimental/packages/opentelemetry-sdk-node/src/sdk.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export class NodeSDK {
208208
return;
209209
}
210210

211+
registerInstrumentations({
212+
instrumentations: this._instrumentations,
213+
});
214+
211215
if (this._autoDetectResources) {
212216
await this.detectResources();
213217
}
@@ -255,10 +259,6 @@ export class NodeSDK {
255259

256260
metrics.setGlobalMeterProvider(meterProvider);
257261
}
258-
259-
registerInstrumentations({
260-
instrumentations: this._instrumentations,
261-
});
262262
}
263263

264264
public shutdown(): Promise<void> {

0 commit comments

Comments
 (0)