Skip to content

Commit 774d254

Browse files
authored
fix(document-load): compatibility issue with @opentelemetry/[email protected] (#1565)
1 parent a18b074 commit 774d254

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

plugins/web/opentelemetry-instrumentation-document-load/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@opentelemetry/core": "^1.8.0",
8080
"@opentelemetry/instrumentation": "^0.40.0",
8181
"@opentelemetry/sdk-trace-base": "^1.0.0",
82-
"@opentelemetry/sdk-trace-web": "^1.8.0",
82+
"@opentelemetry/sdk-trace-web": "^1.15.0",
8383
"@opentelemetry/semantic-conventions": "^1.0.0",
8484
"tslib": "^2.3.1"
8585
},

plugins/web/opentelemetry-instrumentation-document-load/test/documentLoad.test.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,10 @@ function ensureNetworkEventsExists(events: TimedEvent[]) {
210210
assert.strictEqual(events[1].name, PTN.DOMAIN_LOOKUP_START);
211211
assert.strictEqual(events[2].name, PTN.DOMAIN_LOOKUP_END);
212212
assert.strictEqual(events[3].name, PTN.CONNECT_START);
213-
assert.strictEqual(events[4].name, PTN.SECURE_CONNECTION_START);
214-
assert.strictEqual(events[5].name, PTN.CONNECT_END);
215-
assert.strictEqual(events[6].name, PTN.REQUEST_START);
216-
assert.strictEqual(events[7].name, PTN.RESPONSE_START);
217-
assert.strictEqual(events[8].name, PTN.RESPONSE_END);
213+
assert.strictEqual(events[4].name, PTN.CONNECT_END);
214+
assert.strictEqual(events[5].name, PTN.REQUEST_START);
215+
assert.strictEqual(events[6].name, PTN.RESPONSE_START);
216+
assert.strictEqual(events[7].name, PTN.RESPONSE_END);
218217
}
219218

220219
describe('DocumentLoad Instrumentation', () => {
@@ -370,7 +369,7 @@ describe('DocumentLoad Instrumentation', () => {
370369
assert.strictEqual(fsEvents[7].name, PTN.LOAD_EVENT_START);
371370
assert.strictEqual(fsEvents[8].name, PTN.LOAD_EVENT_END);
372371

373-
assert.strictEqual(rsEvents.length, 9);
372+
assert.strictEqual(rsEvents.length, 8);
374373
assert.strictEqual(fsEvents.length, 11);
375374
assert.strictEqual(exporter.getFinishedSpans().length, 2);
376375
done();
@@ -486,15 +485,7 @@ describe('DocumentLoad Instrumentation', () => {
486485
'http://localhost:8090/bundle.js'
487486
);
488487

489-
assert.strictEqual(srEvents1[0].name, PTN.FETCH_START);
490-
assert.strictEqual(srEvents1[1].name, PTN.DOMAIN_LOOKUP_START);
491-
assert.strictEqual(srEvents1[2].name, PTN.DOMAIN_LOOKUP_END);
492-
assert.strictEqual(srEvents1[3].name, PTN.CONNECT_START);
493-
assert.strictEqual(srEvents1[4].name, PTN.SECURE_CONNECTION_START);
494-
assert.strictEqual(srEvents1[5].name, PTN.CONNECT_END);
495-
assert.strictEqual(srEvents1[6].name, PTN.REQUEST_START);
496-
assert.strictEqual(srEvents1[7].name, PTN.RESPONSE_START);
497-
assert.strictEqual(srEvents1[8].name, PTN.RESPONSE_END);
488+
ensureNetworkEventsExists(srEvents1);
498489

499490
assert.strictEqual(exporter.getFinishedSpans().length, 3);
500491
done();
@@ -570,7 +561,7 @@ describe('DocumentLoad Instrumentation', () => {
570561
assert.strictEqual(rsEvents[7].name, PTN.LOAD_EVENT_START);
571562
assert.strictEqual(rsEvents[8].name, PTN.LOAD_EVENT_END);
572563

573-
assert.strictEqual(fsEvents.length, 9);
564+
assert.strictEqual(fsEvents.length, 8);
574565
assert.strictEqual(rsEvents.length, 9);
575566
assert.strictEqual(exporter.getFinishedSpans().length, 2);
576567
done();

0 commit comments

Comments
 (0)