Skip to content

Commit a346e4c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into timfish/feat/new-anr
2 parents 5289d11 + 510ba3e commit a346e4c

File tree

104 files changed

+1809
-477
lines changed

Some content is hidden

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

104 files changed

+1809
-477
lines changed

CHANGELOG.md

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

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

7+
## 9.32.0
8+
9+
### Important Changes
10+
11+
- feat(browser): Add CLS sources to span attributes ([#16710](https://github.com/getsentry/sentry-javascript/pull/16710))
12+
13+
Enhances CLS (Cumulative Layout Shift) spans by adding attributes detailing the elements that caused layout shifts.
14+
15+
- feat(cloudflare): Add `instrumentWorkflowWithSentry` to instrument workflows ([#16672](https://github.com/getsentry/sentry-javascript/pull/16672))
16+
17+
We've added support for Cloudflare Workflows, enabling comprehensive tracing for your workflow runs. This integration uses the workflow's instanceId as the Sentry trace_id and for sampling, linking all steps together. You'll now be able to see full traces, including retries with exponential backoff.
18+
19+
- feat(pino-transport): Add functionality to send logs to sentry ([#16667](https://github.com/getsentry/sentry-javascript/pull/16667))
20+
21+
Adds the ability to send logs to Sentry via a pino transport.
22+
23+
### Other Changes
24+
25+
- feat(nextjs): Expose top level buildTime `errorHandler` option ([#16718](https://github.com/getsentry/sentry-javascript/pull/16718))
26+
- feat(node): update pipeline spans to use agent naming ([#16712](https://github.com/getsentry/sentry-javascript/pull/16712))
27+
- feat(deps): bump @prisma/instrumentation from 6.9.0 to 6.10.1 ([#16698](https://github.com/getsentry/sentry-javascript/pull/16698))
28+
- fix(sveltekit): Export logger from sveltekit worker ([#16716](https://github.com/getsentry/sentry-javascript/pull/16716))
29+
- fix(google-cloud-serverless): Make `CloudEventsContext` compatible with `CloudEvent` ([#16705](https://github.com/getsentry/sentry-javascript/pull/16705))
30+
- fix(nextjs): Stop injecting release value when create release options is set to `false` ([#16695](https://github.com/getsentry/sentry-javascript/pull/16695))
31+
- fix(node): account for Object. syntax with local variables matching ([#16702](https://github.com/getsentry/sentry-javascript/pull/16702))
32+
- fix(nuxt): Add alias for `@opentelemetry/resources` ([#16727](https://github.com/getsentry/sentry-javascript/pull/16727))
33+
734
Work in this release was contributed by @flaeppe. Thank you for your contribution!
835

936
## 9.31.0

dev-packages/browser-integration-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "9.31.0",
3+
"version": "9.32.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -42,7 +42,7 @@
4242
"@babel/preset-typescript": "^7.16.7",
4343
"@playwright/test": "~1.50.0",
4444
"@sentry-internal/rrweb": "2.34.0",
45-
"@sentry/browser": "9.31.0",
45+
"@sentry/browser": "9.32.0",
4646
"@supabase/supabase-js": "2.49.3",
4747
"axios": "1.8.2",
4848
"babel-loader": "^8.2.2",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
// Force this so that the initial sampleRand is consistent
6+
Math.random = () => 0.45;
7+
8+
Sentry.init({
9+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
10+
integrations: [Sentry.browserTracingIntegration()],
11+
tracePropagationTargets: ['http://sentry-test-site.example'],
12+
tracesSampler: ({ name }) => {
13+
if (name === 'new-trace') {
14+
return 0.9;
15+
}
16+
17+
return 0.5;
18+
},
19+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const newTraceBtn = document.getElementById('newTrace');
2+
newTraceBtn.addEventListener('click', async () => {
3+
Sentry.startNewTrace(() => {
4+
// We want to ensure the new trace is sampled, so we force the sample_rand to a value above 0.9
5+
Sentry.getCurrentScope().setPropagationContext({
6+
...Sentry.getCurrentScope().getPropagationContext(),
7+
sampleRand: 0.85,
8+
});
9+
Sentry.startSpan({ op: 'ui.interaction.click', name: 'new-trace' }, async () => {
10+
await fetch('http://sentry-test-site.example');
11+
});
12+
});
13+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<button id="newTrace">new Trace</button>
8+
</body>
9+
</html>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import { expect } from '@playwright/test';
2+
import { sentryTest } from '../../../../utils/fixtures';
3+
import type { EventAndTraceHeader } from '../../../../utils/helpers';
4+
import {
5+
eventAndTraceHeaderRequestParser,
6+
getFirstSentryEnvelopeRequest,
7+
shouldSkipTracingTest,
8+
waitForTransactionRequest,
9+
} from '../../../../utils/helpers';
10+
11+
sentryTest(
12+
'new trace started with `startNewTrace` is sampled according to the `tracesSampler`',
13+
async ({ getLocalTestUrl, page }) => {
14+
if (shouldSkipTracingTest()) {
15+
sentryTest.skip();
16+
}
17+
18+
const url = await getLocalTestUrl({ testDir: __dirname });
19+
20+
await page.route('http://sentry-test-site.example/**', route => {
21+
return route.fulfill({
22+
status: 200,
23+
contentType: 'application/json',
24+
body: JSON.stringify({}),
25+
});
26+
});
27+
28+
const [pageloadEvent, pageloadTraceHeaders] = await getFirstSentryEnvelopeRequest<EventAndTraceHeader>(
29+
page,
30+
url,
31+
eventAndTraceHeaderRequestParser,
32+
);
33+
34+
const pageloadTraceContext = pageloadEvent.contexts?.trace;
35+
36+
expect(pageloadEvent.type).toEqual('transaction');
37+
38+
expect(pageloadTraceContext).toMatchObject({
39+
op: 'pageload',
40+
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
41+
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
42+
data: {
43+
'sentry.sample_rate': 0.5,
44+
},
45+
});
46+
expect(pageloadTraceContext).not.toHaveProperty('parent_span_id');
47+
48+
expect(pageloadTraceHeaders).toEqual({
49+
environment: 'production',
50+
public_key: 'public',
51+
sample_rate: '0.5',
52+
sampled: 'true',
53+
trace_id: pageloadTraceContext?.trace_id,
54+
sample_rand: '0.45',
55+
});
56+
57+
const transactionPromise = waitForTransactionRequest(page, event => {
58+
return event.transaction === 'new-trace';
59+
});
60+
61+
await page.locator('#newTrace').click();
62+
63+
const [newTraceTransactionEvent, newTraceTransactionTraceHeaders] = eventAndTraceHeaderRequestParser(
64+
await transactionPromise,
65+
);
66+
67+
const newTraceTransactionTraceContext = newTraceTransactionEvent.contexts?.trace;
68+
expect(newTraceTransactionTraceContext).toMatchObject({
69+
op: 'ui.interaction.click',
70+
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
71+
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
72+
data: {
73+
'sentry.sample_rate': 0.9,
74+
},
75+
});
76+
77+
expect(newTraceTransactionTraceHeaders).toEqual({
78+
environment: 'production',
79+
public_key: 'public',
80+
sample_rate: '0.9',
81+
sampled: 'true',
82+
trace_id: newTraceTransactionTraceContext?.trace_id,
83+
transaction: 'new-trace',
84+
sample_rand: '0.85',
85+
});
86+
87+
expect(newTraceTransactionTraceContext?.trace_id).not.toEqual(pageloadTraceContext?.trace_id);
88+
},
89+
);

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "9.31.0",
3+
"version": "9.32.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

dev-packages/clear-cache-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/clear-cache-gh-action",
33
"description": "An internal Github Action to clear GitHub caches.",
4-
"version": "9.31.0",
4+
"version": "9.32.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "9.31.0",
3+
"version": "9.32.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {

dev-packages/e2e-tests/test-applications/create-next-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"test:prod": "TEST_ENV=prod playwright test",
99
"test:dev": "TEST_ENV=dev playwright test",
1010
"test:build": "pnpm install && pnpm build",
11-
"test:build-13": "pnpm install && pnpm add next@13.4.19 && pnpm build",
11+
"test:build-13": "pnpm install && pnpm add next@13.5.9 && pnpm build",
1212
"test:assert": "pnpm test:prod && pnpm test:dev"
1313
},
1414
"dependencies": {
1515
"@sentry/nextjs": "latest || *",
1616
"@types/node": "^18.19.1",
1717
"@types/react": "18.0.26",
1818
"@types/react-dom": "18.0.9",
19-
"next": "14.0.0",
19+
"next": "14.2.25",
2020
"react": "18.2.0",
2121
"react-dom": "18.2.0",
2222
"typescript": "~5.0.0"

dev-packages/e2e-tests/test-applications/nextjs-13/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/node": "^18.19.1",
1818
"@types/react": "18.0.26",
1919
"@types/react-dom": "18.0.9",
20-
"next": "13.5.7",
20+
"next": "13.5.9",
2121
"react": "18.2.0",
2222
"react-dom": "18.2.0",
2323
"typescript": "~5.0.0"

dev-packages/e2e-tests/test-applications/nextjs-app-dir/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test:test-build": "pnpm ts-node --script-mode assert-build.ts",
1212
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && pnpm build",
1313
"test:build-latest": "pnpm install && pnpm add next@latest && pnpm build",
14-
"test:build-13": "pnpm install && pnpm add next@13.4.19 && pnpm build",
14+
"test:build-13": "pnpm install && pnpm add next@13.5.9 && pnpm build",
1515
"test:assert": "pnpm test:test-build && pnpm test:prod && pnpm test:dev"
1616
},
1717
"dependencies": {

dev-packages/e2e-tests/test-applications/node-fastify-5/src/app.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const app = fastify();
3434
const port = 3030;
3535
const port2 = 3040;
3636

37-
Sentry.setupFastifyErrorHandler(app);
38-
3937
app.get('/test-success', function (_req, res) {
4038
res.send({ version: 'v1' });
4139
});

dev-packages/e2e-tests/test-applications/nuxt-4/app/app.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
</NuxtLayout>
1414
</template>
1515

16-
<script setup>
16+
<script setup lang="ts">
17+
import { useSentryTestTag } from '#imports';
18+
19+
useSentryTestTag();
1720
</script>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// fixme: this needs to be imported from @sentry/core, not @sentry/nuxt in dev mode (because of import-in-the-middle error)
2+
// This could also be a problem with the specific setup of the pnpm E2E test setup, because this could not be reproduced outside of the E2E test.
3+
// Related to this: https://github.com/getsentry/sentry-javascript/issues/15204#issuecomment-2948908130
4+
import { setTag } from '@sentry/nuxt';
5+
6+
export default function useSentryTestTag(): void {
7+
setTag('test-tag', null);
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineNuxtModule } from 'nuxt/kit';
2+
3+
// Just a fake module to check if the SDK works alongside other local Nuxt modules without breaking the build
4+
export default defineNuxtModule({
5+
meta: { name: 'another-module' },
6+
setup() {
7+
console.log('another-module setup called');
8+
},
9+
});

dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
33
future: { compatibilityVersion: 4 },
4-
compatibilityDate: '2024-04-03',
4+
compatibilityDate: '2025-06-06',
55
imports: { autoImport: false },
66

77
modules: ['@pinia/nuxt', '@sentry/nuxt/module'],

dev-packages/e2e-tests/test-applications/nuxt-4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@pinia/nuxt": "^0.5.5",
2020
"@sentry/nuxt": "latest || *",
21-
"nuxt": "^3.13.2"
21+
"nuxt": "^3.17.5"
2222
},
2323
"devDependencies": {
2424
"@playwright/test": "~1.50.0",

dev-packages/external-contributor-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/external-contributor-gh-action",
33
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
4-
"version": "9.31.0",
4+
"version": "9.32.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/node-integration-tests/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/node-integration-tests",
3-
"version": "9.31.0",
3+
"version": "9.32.0",
44
"license": "MIT",
55
"engines": {
66
"node": ">=18"
@@ -30,9 +30,9 @@
3030
"@nestjs/common": "11.0.16",
3131
"@nestjs/core": "10.4.6",
3232
"@nestjs/platform-express": "10.4.6",
33-
"@sentry/aws-serverless": "9.31.0",
34-
"@sentry/core": "9.31.0",
35-
"@sentry/node": "9.31.0",
33+
"@sentry/aws-serverless": "9.32.0",
34+
"@sentry/core": "9.32.0",
35+
"@sentry/node": "9.32.0",
3636
"@types/mongodb": "^3.6.20",
3737
"@types/mysql": "^2.15.21",
3838
"@types/pg": "^8.6.5",
@@ -61,6 +61,7 @@
6161
"node-cron": "^3.0.3",
6262
"node-schedule": "^2.1.1",
6363
"pg": "8.16.0",
64+
"postgres": "^3.4.7",
6465
"proxy": "^2.1.1",
6566
"redis-4": "npm:redis@^4.6.14",
6667
"reflect-metadata": "0.2.1",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.9'
2+
3+
services:
4+
db:
5+
image: postgres:13
6+
restart: always
7+
container_name: integration-tests-postgresjs
8+
ports:
9+
- '5444:5432'
10+
environment:
11+
POSTGRES_USER: test
12+
POSTGRES_PASSWORD: test
13+
POSTGRES_DB: test_db

0 commit comments

Comments
 (0)