Skip to content

Commit ae901c3

Browse files
authored
Merge pull request #13770 from getsentry/prepare-release/8.32.0
meta(changelog): Update changelog for 8.32.0
2 parents d4f95c8 + 0a21708 commit ae901c3

File tree

98 files changed

+1901
-458
lines changed

Some content is hidden

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

98 files changed

+1901
-458
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ jobs:
895895
'node-express-cjs-preload',
896896
'node-otel-sdk-node',
897897
'node-otel-custom-sampler',
898+
'node-otel-without-tracing',
898899
'ember-classic',
899900
'ember-embroider',
900901
'nextjs-app-dir',
@@ -923,6 +924,7 @@ jobs:
923924
'nestjs-distributed-tracing',
924925
'nestjs-with-submodules',
925926
'nestjs-with-submodules-decorator',
927+
'nestjs-basic-with-graphql',
926928
'nestjs-graphql',
927929
'node-exports-test-app',
928930
'node-koa',

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ local.log
4343
.rpt2_cache
4444

4545
lint-results.json
46+
trace.zip
4647

4748
# legacy
4849
tmp.js
@@ -58,3 +59,6 @@ packages/deno/lib.deno.d.ts
5859

5960
# gatsby
6061
packages/gatsby/gatsby-node.d.ts
62+
63+
# intellij
64+
*.iml

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,41 @@
1010

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

13+
## 8.32.0
14+
15+
### Important Changes
16+
17+
- **ref(browser): Move navigation span descriptions into op
18+
([#13527](https://github.com/getsentry/sentry-javascript/pull/13527))**
19+
20+
Moves the description of navigation related browser spans into the op, e.g. browser - cache -> browser.cache and sets
21+
the description to the performanceEntry objects' names (in this context it is the URL of the page).
22+
23+
- **feat(node): Add amqplibIntegration ([#13714](https://github.com/getsentry/sentry-javascript/pull/13714))**
24+
25+
- **feat(nestjs): Add `SentryGlobalGenericFilter` and allow specifying application ref in global filter
26+
([#13673](https://github.com/getsentry/sentry-javascript/pull/13673))**
27+
28+
Adds a `SentryGlobalGenericFilter` that filters both graphql and http exceptions depending on the context.
29+
30+
- **feat: Set log level for Fetch/XHR breadcrumbs based on status code
31+
([#13711](https://github.com/getsentry/sentry-javascript/pull/13711))**
32+
33+
Sets log levels in breadcrumbs for 5xx to error and 4xx to warning.
34+
35+
### Other Changes
36+
37+
- chore(nextjs): Bump rollup to 3.29.5 ([#13761](https://github.com/getsentry/sentry-javascript/pull/13761))
38+
- fix(core): Remove `sampled` flag from dynamic sampling context in Tracing without Performance mode
39+
([#13753](https://github.com/getsentry/sentry-javascript/pull/13753))
40+
- fix(node): Ensure node-fetch does not emit spans without tracing
41+
([#13765](https://github.com/getsentry/sentry-javascript/pull/13765))
42+
- fix(nuxt): Use Nuxt error hooks instead of errorHandler to prevent 500
43+
([#13748](https://github.com/getsentry/sentry-javascript/pull/13748))
44+
- fix(test): Unflake LCP test ([#13741](https://github.com/getsentry/sentry-javascript/pull/13741))
45+
46+
Work in this release was contributed by @Zen-cronic and @Sjoertjuh. Thank you for your contributions!
47+
1348
## 8.31.0
1449

1550
### Important Changes
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fetch('http://sentry-test.io/foo').then(() => {
2+
Sentry.captureException('test error');
3+
});
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
6+
7+
sentryTest('captures Breadcrumb with log level for 4xx response code', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
9+
10+
await page.route('**/foo', async route => {
11+
await route.fulfill({
12+
status: 404,
13+
contentType: 'text/plain',
14+
body: 'Not Found!',
15+
});
16+
});
17+
18+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19+
20+
expect(eventData.exception?.values).toHaveLength(1);
21+
22+
expect(eventData?.breadcrumbs?.length).toBe(1);
23+
expect(eventData!.breadcrumbs![0]).toEqual({
24+
timestamp: expect.any(Number),
25+
category: 'fetch',
26+
type: 'http',
27+
data: {
28+
method: 'GET',
29+
status_code: 404,
30+
url: 'http://sentry-test.io/foo',
31+
},
32+
level: 'warning',
33+
});
34+
35+
await page.route('**/foo', async route => {
36+
await route.fulfill({
37+
status: 500,
38+
contentType: 'text/plain',
39+
body: 'Internal Server Error',
40+
});
41+
});
42+
});
43+
44+
sentryTest('captures Breadcrumb with log level for 5xx response code', async ({ getLocalTestUrl, page }) => {
45+
const url = await getLocalTestUrl({ testDir: __dirname });
46+
47+
await page.route('**/foo', async route => {
48+
await route.fulfill({
49+
status: 500,
50+
contentType: 'text/plain',
51+
body: 'Internal Server Error',
52+
});
53+
});
54+
55+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
56+
57+
expect(eventData.exception?.values).toHaveLength(1);
58+
59+
expect(eventData?.breadcrumbs?.length).toBe(1);
60+
expect(eventData!.breadcrumbs![0]).toEqual({
61+
timestamp: expect.any(Number),
62+
category: 'fetch',
63+
type: 'http',
64+
data: {
65+
method: 'GET',
66+
status_code: 500,
67+
url: 'http://sentry-test.io/foo',
68+
},
69+
level: 'error',
70+
});
71+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const xhr = new XMLHttpRequest();
2+
3+
xhr.open('GET', 'http://sentry-test.io/foo');
4+
xhr.send();
5+
6+
xhr.addEventListener('readystatechange', function () {
7+
if (xhr.readyState === 4) {
8+
Sentry.captureException('test error');
9+
}
10+
});
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
6+
7+
sentryTest('captures Breadcrumb with log level for 4xx response code', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
9+
10+
await page.route('**/foo', async route => {
11+
await route.fulfill({
12+
status: 404,
13+
contentType: 'text/plain',
14+
body: 'Not Found!',
15+
});
16+
});
17+
18+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19+
20+
expect(eventData.exception?.values).toHaveLength(1);
21+
22+
expect(eventData?.breadcrumbs?.length).toBe(1);
23+
expect(eventData!.breadcrumbs![0]).toEqual({
24+
timestamp: expect.any(Number),
25+
category: 'xhr',
26+
type: 'http',
27+
data: {
28+
method: 'GET',
29+
status_code: 404,
30+
url: 'http://sentry-test.io/foo',
31+
},
32+
level: 'warning',
33+
});
34+
35+
await page.route('**/foo', async route => {
36+
await route.fulfill({
37+
status: 500,
38+
contentType: 'text/plain',
39+
body: 'Internal Server Error',
40+
});
41+
});
42+
});
43+
44+
sentryTest('captures Breadcrumb with log level for 5xx response code', async ({ getLocalTestUrl, page }) => {
45+
const url = await getLocalTestUrl({ testDir: __dirname });
46+
47+
await page.route('**/foo', async route => {
48+
await route.fulfill({
49+
status: 500,
50+
contentType: 'text/plain',
51+
body: 'Internal Server Error',
52+
});
53+
});
54+
55+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
56+
57+
expect(eventData.exception?.values).toHaveLength(1);
58+
59+
expect(eventData?.breadcrumbs?.length).toBe(1);
60+
expect(eventData!.breadcrumbs![0]).toEqual({
61+
timestamp: expect.any(Number),
62+
category: 'xhr',
63+
type: 'http',
64+
data: {
65+
method: 'GET',
66+
status_code: 500,
67+
url: 'http://sentry-test.io/foo',
68+
},
69+
level: 'error',
70+
});
71+
});

dev-packages/browser-integration-tests/suites/tracing/metrics/handlers-lcp/test.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,39 @@ sentryTest(
2020
);
2121

2222
const url = await getLocalTestPath({ testDir: __dirname });
23+
2324
const [eventData] = await Promise.all([
2425
getFirstSentryEnvelopeRequest<Event>(page),
2526
page.goto(url),
26-
page.click('button'),
27+
page.locator('button').click(),
2728
]);
2829

2930
expect(eventData.measurements).toBeDefined();
3031
expect(eventData.measurements?.lcp?.value).toBeDefined();
3132

32-
expect(eventData.contexts?.trace?.data?.['lcp.element']).toBe('body > img');
33-
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBe(107400);
34-
expect(eventData.contexts?.trace?.data?.['lcp.url']).toBe('https://example.com/path/to/image.png');
33+
// This should be body > img, but it can be flakey as sometimes it will report
34+
// the button as LCP.
35+
expect(eventData.contexts?.trace?.data?.['lcp.element'].startsWith('body >')).toBe(true);
36+
37+
// Working around flakiness
38+
// Only testing this when the LCP element is an image, not a button
39+
if (eventData.contexts?.trace?.data?.['lcp.element'] === 'body > img') {
40+
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBe(107400);
3541

36-
const lcp = await (await page.waitForFunction('window._LCP')).jsonValue();
37-
const lcp2 = await (await page.waitForFunction('window._LCP2')).jsonValue();
38-
const lcp3 = await page.evaluate('window._LCP3');
42+
const lcp = await (await page.waitForFunction('window._LCP')).jsonValue();
43+
const lcp2 = await (await page.waitForFunction('window._LCP2')).jsonValue();
44+
const lcp3 = await page.evaluate('window._LCP3');
3945

40-
expect(lcp).toEqual(107400);
41-
expect(lcp2).toEqual(107400);
42-
// this has not been triggered yet
43-
expect(lcp3).toEqual(undefined);
46+
expect(lcp).toEqual(107400);
47+
expect(lcp2).toEqual(107400);
48+
// this has not been triggered yet
49+
expect(lcp3).toEqual(undefined);
4450

45-
// Adding a handler after LCP is completed still triggers the handler
46-
await page.evaluate('window.ADD_HANDLER()');
47-
const lcp3_2 = await (await page.waitForFunction('window._LCP3')).jsonValue();
51+
// Adding a handler after LCP is completed still triggers the handler
52+
await page.evaluate('window.ADD_HANDLER()');
53+
const lcp3_2 = await (await page.waitForFunction('window._LCP3')).jsonValue();
4854

49-
expect(lcp3_2).toEqual(107400);
55+
expect(lcp3_2).toEqual(107400);
56+
}
5057
},
5158
);

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
1212
const url = await getLocalTestPath({ testDir: __dirname });
1313

1414
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
15-
const browserSpans = eventData.spans?.filter(({ op }) => op === 'browser');
15+
const browserSpans = eventData.spans?.filter(({ op }) => op?.startsWith('browser'));
1616

1717
// Spans `domContentLoadedEvent`, `connect`, `cache` and `DNS` are not
1818
// always inside `pageload` transaction.
@@ -21,7 +21,8 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
2121
['loadEvent', 'request', 'response'].forEach(eventDesc =>
2222
expect(browserSpans).toContainEqual(
2323
expect.objectContaining({
24-
description: eventDesc,
24+
op: `browser.${eventDesc}`,
25+
description: page.url(),
2526
parent_span_id: eventData.contexts?.trace?.span_id,
2627
}),
2728
),

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-measure-spans/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
1313
const url = await getLocalTestPath({ testDir: __dirname });
1414

1515
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
16-
const browserSpans = eventData.spans?.filter(({ op }) => op === 'browser');
16+
const browserSpans = eventData.spans?.filter(({ op }) => op?.startsWith('browser'));
1717

1818
// Spans `domContentLoadedEvent`, `connect`, `cache` and `DNS` are not
1919
// always inside `pageload` transaction.
2020
expect(browserSpans?.length).toBeGreaterThanOrEqual(4);
2121

22-
const requestSpan = browserSpans!.find(({ description }) => description === 'request');
22+
const requestSpan = browserSpans!.find(({ op }) => op === 'browser.request');
2323
expect(requestSpan).toBeDefined();
24+
expect(requestSpan?.description).toBe(page.url());
2425

2526
const measureSpan = eventData.spans?.find(({ op }) => op === 'measure');
2627
expect(measureSpan).toBeDefined();
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# OS
16+
.DS_Store
17+
18+
# Tests
19+
/coverage
20+
/.nyc_output
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
38+
# dotenv environment variable files
39+
.env
40+
.env.development.local
41+
.env.test.local
42+
.env.production.local
43+
.env.local
44+
45+
# temp directory
46+
.temp
47+
.tmp
48+
49+
# Runtime data
50+
pids
51+
*.pid
52+
*.seed
53+
*.pid.lock
54+
55+
# Diagnostic reports (https://nodejs.org/api/report.html)
56+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

0 commit comments

Comments
 (0)