Skip to content

Commit ae69d5f

Browse files
s1gr1dLms24lforstgithub-actions[bot]timfish
authored
meta(changelog): Update changelog for 8.0.0-beta.2 (#11654)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Lukas Stracke <[email protected]> Co-authored-by: Luca Forstner <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tim Fish <[email protected]> Co-authored-by: Francesco Novy <[email protected]> Co-authored-by: Catherine Lee <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 0b97b02 commit ae69d5f

File tree

109 files changed

+3130
-1986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3130
-1986
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module.exports = [
208208
'tls',
209209
],
210210
gzip: true,
211-
limit: '150 KB',
211+
limit: '160 KB',
212212
},
213213
];
214214

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,35 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 8.0.0-beta.2
8+
9+
### Important Changes
10+
11+
- **feat(browser): Update `propagationContext` on `spanEnd` to keep trace consistent**
12+
13+
To ensure consistency throughout a route's duration, we update the scope's propagation context when the initial page
14+
load or navigation span ends. This keeps span-specific attributes like the sampled decision and dynamic sampling context
15+
on the scope, even after the transaction has ended.
16+
17+
- **fix(browser): Don't assume window.document is available (#11602)**
18+
19+
We won't assume `window.dodument` is available in the browser SDKs anymore. This should prevent errors in environments
20+
where `window.document` is not available (such as web workers).
21+
22+
### Other changes
23+
24+
- feat(core): Add `server.address` to browser `http.client` spans (#11634)
25+
- feat(opentelemetry): Update OTEL packages & relax some version ranges (#11580)
26+
- feat(deps): bump @opentelemetry/instrumentation-hapi from 0.34.0 to 0.36.0 (#11496)
27+
- feat(deps): bump @opentelemetry/instrumentation-koa from 0.37.0 to 0.39.0 (#11495)
28+
- feat(deps): bump @opentelemetry/instrumentation-pg from 0.38.0 to 0.40.0 (#11494)
29+
- feat(nextjs): Skip OTEL root spans emitted by Next.js (#11623)
30+
- feat(node): Collect Local Variables via a worker (#11586)
31+
- fix(nextjs): Escape Next.js' OpenTelemetry instrumentation (#11625)
32+
- fix(feedback): Fix timeout on feedback submission (#11619)
33+
- fix(node): Allow use of `NodeClient` without calling `init` (#11585)
34+
- fix(node): Ensure DSC is correctly set in envelope headers (#11628)
35+
736
## 8.0.0-beta.1
837

938
This is the first beta release of Sentry JavaScript SDK v8. With this release, there are no more planned breaking
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracesSampleRate: 1,
9+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fetch('/test-req/0').then(
2+
fetch('/test-req/1', { headers: { 'X-Test-Header': 'existing-header' } }).then(fetch('/test-req/2')),
3+
);
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
4+
import {
5+
envelopeRequestParser,
6+
shouldSkipTracingTest,
7+
waitForTransactionRequestOnUrl,
8+
} from '../../../../utils/helpers';
9+
10+
sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, page }) => {
11+
if (shouldSkipTracingTest()) {
12+
sentryTest.skip();
13+
}
14+
15+
const url = await getLocalTestUrl({ testDir: __dirname });
16+
const req = await waitForTransactionRequestOnUrl(page, url);
17+
const tracingEvent = envelopeRequestParser(req);
18+
19+
const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');
20+
21+
expect(requestSpans).toHaveLength(3);
22+
23+
requestSpans?.forEach((span, index) =>
24+
expect(span).toMatchObject({
25+
description: `GET /test-req/${index}`,
26+
parent_span_id: tracingEvent.contexts?.trace?.span_id,
27+
span_id: expect.any(String),
28+
start_timestamp: expect.any(Number),
29+
timestamp: expect.any(Number),
30+
trace_id: tracingEvent.contexts?.trace?.trace_id,
31+
data: {
32+
'http.method': 'GET',
33+
'http.url': `${TEST_HOST}/test-req/${index}`,
34+
url: `/test-req/${index}`,
35+
'server.address': 'sentry-test.io',
36+
type: 'fetch',
37+
},
38+
}),
39+
);
40+
});
41+
42+
sentryTest('should attach `sentry-trace` header to fetch requests', async ({ getLocalTestUrl, page }) => {
43+
if (shouldSkipTracingTest()) {
44+
sentryTest.skip();
45+
}
46+
47+
const url = await getLocalTestUrl({ testDir: __dirname });
48+
49+
const requests = (
50+
await Promise.all([
51+
page.goto(url),
52+
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`${TEST_HOST}/test-req/${idx}`))),
53+
])
54+
)[1];
55+
56+
expect(requests).toHaveLength(3);
57+
58+
const request1 = requests[0];
59+
const requestHeaders1 = request1.headers();
60+
expect(requestHeaders1).toMatchObject({
61+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
62+
baggage: expect.any(String),
63+
});
64+
65+
const request2 = requests[1];
66+
const requestHeaders2 = request2.headers();
67+
expect(requestHeaders2).toMatchObject({
68+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
69+
baggage: expect.any(String),
70+
'x-test-header': 'existing-header',
71+
});
72+
73+
const request3 = requests[2];
74+
const requestHeaders3 = request3.headers();
75+
expect(requestHeaders3).toMatchObject({
76+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
77+
baggage: expect.any(String),
78+
});
79+
});

dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestPath,
3636
start_timestamp: expect.any(Number),
3737
timestamp: expect.any(Number),
3838
trace_id: tracingEvent.contexts?.trace?.trace_id,
39+
data: {
40+
'http.method': 'GET',
41+
'http.url': `http://example.com/${index}`,
42+
url: `http://example.com/${index}`,
43+
'server.address': 'example.com',
44+
type: 'fetch',
45+
},
3946
}),
4047
);
4148
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracesSampleRate: 1,
9+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const xhr_1 = new XMLHttpRequest();
2+
xhr_1.open('GET', '/test-req/0');
3+
xhr_1.send();
4+
5+
const xhr_2 = new XMLHttpRequest();
6+
xhr_2.open('GET', '/test-req/1');
7+
xhr_2.setRequestHeader('X-Test-Header', 'existing-header');
8+
xhr_2.send();
9+
10+
const xhr_3 = new XMLHttpRequest();
11+
xhr_3.open('GET', '/test-req/2');
12+
xhr_3.send();
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
4+
import {
5+
envelopeRequestParser,
6+
shouldSkipTracingTest,
7+
waitForTransactionRequestOnUrl,
8+
} from '../../../../utils/helpers';
9+
10+
sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, page }) => {
11+
if (shouldSkipTracingTest()) {
12+
sentryTest.skip();
13+
}
14+
15+
const url = await getLocalTestUrl({ testDir: __dirname });
16+
const req = await waitForTransactionRequestOnUrl(page, url);
17+
const tracingEvent = envelopeRequestParser(req);
18+
19+
const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');
20+
21+
expect(requestSpans).toHaveLength(3);
22+
23+
requestSpans?.forEach((span, index) =>
24+
expect(span).toMatchObject({
25+
description: `GET /test-req/${index}`,
26+
parent_span_id: tracingEvent.contexts?.trace?.span_id,
27+
span_id: expect.any(String),
28+
start_timestamp: expect.any(Number),
29+
timestamp: expect.any(Number),
30+
trace_id: tracingEvent.contexts?.trace?.trace_id,
31+
data: {
32+
'http.method': 'GET',
33+
'http.url': `${TEST_HOST}/test-req/${index}`,
34+
url: `/test-req/${index}`,
35+
'server.address': 'sentry-test.io',
36+
type: 'xhr',
37+
},
38+
}),
39+
);
40+
});
41+
42+
sentryTest('should attach `sentry-trace` header to xhr requests', async ({ getLocalTestUrl, page }) => {
43+
if (shouldSkipTracingTest()) {
44+
sentryTest.skip();
45+
}
46+
47+
const url = await getLocalTestUrl({ testDir: __dirname });
48+
49+
const requests = (
50+
await Promise.all([
51+
page.goto(url),
52+
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`${TEST_HOST}/test-req/${idx}`))),
53+
])
54+
)[1];
55+
56+
expect(requests).toHaveLength(3);
57+
58+
const request1 = requests[0];
59+
const requestHeaders1 = request1.headers();
60+
expect(requestHeaders1).toMatchObject({
61+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
62+
baggage: expect.any(String),
63+
});
64+
65+
const request2 = requests[1];
66+
const requestHeaders2 = request2.headers();
67+
expect(requestHeaders2).toMatchObject({
68+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
69+
baggage: expect.any(String),
70+
'x-test-header': 'existing-header',
71+
});
72+
73+
const request3 = requests[2];
74+
const requestHeaders3 = request3.headers();
75+
expect(requestHeaders3).toMatchObject({
76+
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
77+
baggage: expect.any(String),
78+
});
79+
});

dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestPath, pa
2424
start_timestamp: expect.any(Number),
2525
timestamp: expect.any(Number),
2626
trace_id: eventData.contexts?.trace?.trace_id,
27+
data: {
28+
'http.method': 'GET',
29+
'http.url': `http://example.com/${index}`,
30+
url: `http://example.com/${index}`,
31+
'server.address': 'example.com',
32+
type: 'xhr',
33+
},
2734
}),
2835
);
2936
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Tests in this suite are meant to test the lifetime of a trace in the browser SDK and how different events sent are
2+
connected to a trace. This suite distinguishes the following cases:
3+
4+
1. `pageload` - Traces started on the initial pageload as head of trace
5+
2. `pageload-meta` - Traces started on the initial pageload as a continuation of the trace on the server (via `<meta>`
6+
tags)
7+
3. `navigation` - Traces started during navigations on a page
8+
9+
Tests scenarios should be fairly similar for all three cases but it's important we test all of them.

dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://example.com'],
89
tracesSampleRate: 1,
910
});

0 commit comments

Comments
 (0)