Skip to content

meta(changelog): Update changelog for 9.33.0 #16750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@

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

## 9.33.0

### Important Changes

- **feat: Add opt-in `vercelAiIntegration` to cloudflare & vercel-edge ([#16732](https://github.com/getsentry/sentry-javascript/pull/16732))**

The `vercelAiIntegration` is now available as opt-in for the Cloudflare and the Next.js SDK for Vercel Edge.
To use it, add the integration in `Sentry.init`

```js
Sentry.init({
tracesSampleRate: 1.0,
integrations: [Sentry.vercelAIIntegration()],
});
```

And enable telemetry for Vercel AI calls

```js
const result = await generateText({
model: openai('gpt-4o'),
experimental_telemetry: {
isEnabled: true,
},
});
```

- **feat(node): Add postgresjs instrumentation ([#16665](https://github.com/getsentry/sentry-javascript/pull/16665))**

The Node.js SDK now includes instrumentation for [Postgres.js](https://www.npmjs.com/package/postgres).

- **feat(node): Use diagnostics channel for Fastify v5 error handling ([#16715](https://github.com/getsentry/sentry-javascript/pull/16715))**

If you're on Fastify v5, you no longer need to call `setupFastifyErrorHandler`. It is done automatically by the node SDK. Older versions still rely on calling `setupFastifyErrorHandler`.

### Other Changes

- feat(cloudflare): Allow interop with OpenTelemetry emitted spans ([#16714](https://github.com/getsentry/sentry-javascript/pull/16714))
- feat(cloudflare): Flush after `waitUntil` ([#16681](https://github.com/getsentry/sentry-javascript/pull/16681))
- fix(nextjs): Remove `ai` from default server external packages ([#16736](https://github.com/getsentry/sentry-javascript/pull/16736))

Work in this release was contributed by @0xbad0c0d3. Thank you for your contribution!

## 9.32.0

### Important Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

// Force this so that the initial sampleRand is consistent
Math.random = () => 0.45;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://sentry-test-site.example'],
tracesSampler: ({ name }) => {
if (name === 'new-trace') {
return 0.9;
}

return 0.5;
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const newTraceBtn = document.getElementById('newTrace');
newTraceBtn.addEventListener('click', async () => {
Sentry.startNewTrace(() => {
// We want to ensure the new trace is sampled, so we force the sample_rand to a value above 0.9
Sentry.getCurrentScope().setPropagationContext({
...Sentry.getCurrentScope().getPropagationContext(),
sampleRand: 0.85,
});
Sentry.startSpan({ op: 'ui.interaction.click', name: 'new-trace' }, async () => {
await fetch('http://sentry-test-site.example');
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button id="newTrace">new Trace</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import type { EventAndTraceHeader } from '../../../../utils/helpers';
import {
eventAndTraceHeaderRequestParser,
getFirstSentryEnvelopeRequest,
shouldSkipTracingTest,
waitForTransactionRequest,
} from '../../../../utils/helpers';

sentryTest(
'new trace started with `startNewTrace` is sampled according to the `tracesSampler`',
async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('http://sentry-test-site.example/**', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({}),
});
});

const [pageloadEvent, pageloadTraceHeaders] = await getFirstSentryEnvelopeRequest<EventAndTraceHeader>(
page,
url,
eventAndTraceHeaderRequestParser,
);

const pageloadTraceContext = pageloadEvent.contexts?.trace;

expect(pageloadEvent.type).toEqual('transaction');

expect(pageloadTraceContext).toMatchObject({
op: 'pageload',
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
data: {
'sentry.sample_rate': 0.5,
},
});
expect(pageloadTraceContext).not.toHaveProperty('parent_span_id');

expect(pageloadTraceHeaders).toEqual({
environment: 'production',
public_key: 'public',
sample_rate: '0.5',
sampled: 'true',
trace_id: pageloadTraceContext?.trace_id,
sample_rand: '0.45',
});

const transactionPromise = waitForTransactionRequest(page, event => {
return event.transaction === 'new-trace';
});

await page.locator('#newTrace').click();

const [newTraceTransactionEvent, newTraceTransactionTraceHeaders] = eventAndTraceHeaderRequestParser(
await transactionPromise,
);

const newTraceTransactionTraceContext = newTraceTransactionEvent.contexts?.trace;
expect(newTraceTransactionTraceContext).toMatchObject({
op: 'ui.interaction.click',
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
data: {
'sentry.sample_rate': 0.9,
},
});

expect(newTraceTransactionTraceHeaders).toEqual({
environment: 'production',
public_key: 'public',
sample_rate: '0.9',
sampled: 'true',
trace_id: newTraceTransactionTraceContext?.trace_id,
transaction: 'new-trace',
sample_rand: '0.85',
});

expect(newTraceTransactionTraceContext?.trace_id).not.toEqual(pageloadTraceContext?.trace_id);
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"test:prod": "TEST_ENV=prod playwright test",
"test:dev": "TEST_ENV=dev playwright test",
"test:build": "pnpm install && pnpm build",
"test:build-13": "pnpm install && pnpm add next@13.4.19 && pnpm build",
"test:build-13": "pnpm install && pnpm add next@13.5.9 && pnpm build",
"test:assert": "pnpm test:prod && pnpm test:dev"
},
"dependencies": {
"@sentry/nextjs": "latest || *",
"@types/node": "^18.19.1",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"next": "14.0.0",
"next": "14.2.25",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "~5.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "^18.19.1",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"next": "13.5.7",
"next": "13.5.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "~5.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:test-build": "pnpm ts-node --script-mode assert-build.ts",
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && pnpm build",
"test:build-latest": "pnpm install && pnpm add next@latest && pnpm build",
"test:build-13": "pnpm install && pnpm add next@13.4.19 && pnpm build",
"test:build-13": "pnpm install && pnpm add next@13.5.9 && pnpm build",
"test:assert": "pnpm test:test-build && pnpm test:prod && pnpm test:dev"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const app = fastify();
const port = 3030;
const port2 = 3040;

Sentry.setupFastifyErrorHandler(app);

app.get('/test-success', function (_req, res) {
res.send({ version: 'v1' });
});
Expand Down
5 changes: 4 additions & 1 deletion dev-packages/e2e-tests/test-applications/nuxt-4/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
</NuxtLayout>
</template>

<script setup>
<script setup lang="ts">
import { useSentryTestTag } from '#imports';

useSentryTestTag();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// fixme: this needs to be imported from @sentry/core, not @sentry/nuxt in dev mode (because of import-in-the-middle error)
// 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.
// Related to this: https://github.com/getsentry/sentry-javascript/issues/15204#issuecomment-2948908130
import { setTag } from '@sentry/nuxt';

export default function useSentryTestTag(): void {
setTag('test-tag', null);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineNuxtModule } from 'nuxt/kit';

// Just a fake module to check if the SDK works alongside other local Nuxt modules without breaking the build
export default defineNuxtModule({
meta: { name: 'another-module' },
setup() {
console.log('another-module setup called');
},
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
future: { compatibilityVersion: 4 },
compatibilityDate: '2024-04-03',
compatibilityDate: '2025-06-06',
imports: { autoImport: false },

modules: ['@pinia/nuxt', '@sentry/nuxt/module'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@pinia/nuxt": "^0.5.5",
"@sentry/nuxt": "latest || *",
"nuxt": "^3.13.2"
"nuxt": "^3.17.5"
},
"devDependencies": {
"@playwright/test": "~1.50.0",
Expand Down
1 change: 1 addition & 0 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"node-cron": "^3.0.3",
"node-schedule": "^2.1.1",
"pg": "8.16.0",
"postgres": "^3.4.7",
"proxy": "^2.1.1",
"redis-4": "npm:redis@^4.6.14",
"reflect-metadata": "0.2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.9'

services:
db:
image: postgres:13
restart: always
container_name: integration-tests-postgresjs
ports:
- '5444:5432'
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test_db
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
const Sentry = require('@sentry/node');

Sentry.init({
dsn: 'https://[email protected]/1337',
release: '1.0',
tracesSampleRate: 1.0,
transport: loggingTransport,
});

// Stop the process from exiting before the transaction is sent
setInterval(() => {}, 1000);

const postgres = require('postgres');

const sql = postgres({ port: 5444, user: 'test', password: 'test', database: 'test_db' });

async function run() {
await Sentry.startSpan(
{
name: 'Test Transaction',
op: 'transaction',
},
async () => {
try {
await sql`
CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"));
`;

await sql`
INSERT INTO "User" ("email", "name") VALUES ('Foo', '[email protected]');
`;

await sql`
UPDATE "User" SET "name" = 'Foo' WHERE "email" = '[email protected]';
`;

await sql`
SELECT * FROM "User" WHERE "email" = '[email protected]';
`;

await sql`SELECT * from generate_series(1,1000) as x `.cursor(10, async rows => {
await Promise.all(rows);
});

await sql`
DROP TABLE "User";
`;

// This will be captured as an error as the table no longer exists
await sql`
SELECT * FROM "User" WHERE "email" = '[email protected]';
`;
} finally {
await sql.end();
}
},
);
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
run();
Loading
Loading