Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

`Sentry.cron.instrumentCron`, `instrumentNodeCron` and `instrumentNodeSchedule` send the server's time zone when a job has none, so monitors don't report false misses on servers that aren't on UTC. Schedules Sentry can't express exactly, such as per-second schedules, send no monitor config, so the monitor keeps the schedule set in Sentry. `Sentry.cron.instrumentNodeCron` is deprecated; use `nodeCronIntegration` instead.

- **fix(nuxt): Name the database system in `db.system.name` of db0 spans ([#26285](https://github.com/getsentry/sentry-javascript/pull/26285))**

Nitro database (db0) spans now set `db.system.name` to the database system of the connector's dialect (`mysql`, `postgresql`, `sqlite` or `libsql`), as the OpenTelemetry conventions define it, instead of the connector name. For example, spans of the `mysql2` and `planetscale` connectors now report `mysql`, and spans of `better-sqlite3` and `cloudflare-d1` now report `sqlite`. Update saved queries, alerts and dashboards that filter on the connector names.

## 11.13.0

### Important Changes
Expand Down
15 changes: 12 additions & 3 deletions dev-packages/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,21 @@ is the reference setup.
values that come from its `init()` (`sdk.name`, default integrations) are Node-only. Next.js is different: it loads
`instrumentation.ts` on every runtime, so `nextjs-16` calls `init()` of `@sentry/nextjs` on Bun and Deno too. Its
Bun and Deno variants build the app on that runtime, so `@sentry/nextjs` loads its `bun` or `deno` entry, which adds
the integrations of `@sentry/bun` or `@sentry/deno`.
the integrations of `@sentry/bun` or `@sentry/deno`. Nuxt is similar: `@sentry/nuxt` bundles `sentry.server.config.ts`
into the Nitro output, so `nuxt-4` calls `init()` of `@sentry/nuxt` on Bun and Deno too. `sentry.server.config.bun.ts`
and `sentry.server.config.deno.ts` add the integrations of `@sentry/bun` or `@sentry/deno`. On Cloudflare, `nuxt-4`
builds with the `cloudflare_module` preset and sets up the SDK with `sentryCloudflareNitroPlugin`, which
`nuxt.config.ts` adds only for that runtime. Like the documented Cloudflare setup, that build has no
`sentry.server.config.ts`: a runtime-specific file can replace a file but not remove it, so the build command deletes
it. Nitro turns every file under `server/api` into a route, so
`nuxt.config.ts` lists the runtime-specific files there (such as `db-mongoose.cloudflare.ts`) in Nitro's `ignore`.
- **Start commands**: `playwright.config.mjs` selects the start command with `getRuntime()`. Bun and Deno use the same build
as Node and only change the start command, for example
`bun --bun --preload ./instrument.bun.mjs ./node_modules/@react-router/serve/bin.cjs ./build/server/index.js` and
`deno run -A --preload=@sentry/deno/import --preload=./instrument.deno.mjs ./node_modules/@react-router/serve/bin.cjs ./build/server/index.js`.
The app's `deno.json` maps `@sentry/deno/import` to `node_modules`, because the e2e dependencies are `file:` tarballs
that `npm:@sentry/deno/import` does not resolve.
that `npm:@sentry/deno/import` does not resolve. `nuxt-4` starts the Nitro output with no preload:
`bun .output/server/index.mjs` and `deno run -A .output/server/index.mjs`.
- **Cloudflare**: the app has the Cloudflare dependencies installed all the time. The Cloudflare build has its own
`vite.cloudflare.config.ts` with `@cloudflare/vite-plugin` and `sentryCloudflareVitePlugin` from
`@sentry/cloudflare/vite`, which the runner uses in place of `vite.config.ts` (see runtime-specific files). List the
Expand Down Expand Up @@ -216,7 +224,8 @@ is the reference setup.
example Express behind `react-router-serve`), so those produce no spans on Bun. Where a test depends on them, branch
on `RUNTIME` and say why in a comment. An app that starts its own server can instead bundle it with
`@sentry/bun/plugin`, as `nestjs-12/bun-build.mjs` does. Bun 1.3 renames classes in bundles (`class Foo2`), which
changes span names taken from class names, so `nestjs-12` pins Bun 1.4 (see #26289).
changes span names taken from class names, so `nestjs-12` pins Bun 1.4 (see #26289). `nuxt-4` builds with
`bun --bun nuxt build` on Bun, because the Nitro prerenderer loads its `bun-sqlite` connector in the build process.

```json
"sentryTest": {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default defineNitroPlugin(
sentryCloudflareNitroPlugin({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
tracesSampleRate: 1.0,
enableLogs: true,
tunnel: 'http://localhost:3031/', // proxy server
// Several tests trigger the same server error one after another, which Dedupe would drop.
integrations: integrations => [...integrations.filter(integration => integration.name !== 'Dedupe')],
}),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Simulates a v10-style `bun --preload` that fully initializes the SDK
// before the config bundled into the server build runs its own `Sentry.init`.
import { bunHttpServerIntegration } from '@sentry/bun';
import * as Sentry from '@sentry/nuxt';

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
tracesSampleRate: 1.0,
tunnel: 'http://localhost:3031/',
integrations: [bunHttpServerIntegration()],
});
39 changes: 27 additions & 12 deletions dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
// The runtime variants set `RUNTIME` for the build, see dev-packages/e2e-tests/README.md.
const runtime = process.env.RUNTIME || 'node';
const cloudflare = runtime === 'cloudflare';

// `node:sqlite` is not available on Bun, which has its own SQLite module, and on Cloudflare, which has D1.
function database(name: string, binding: string) {
if (cloudflare) {
return { connector: 'cloudflare-d1', options: { bindingName: binding } };
}
return { connector: runtime === 'bun' ? 'bun-sqlite' : 'sqlite', options: { name } };
}

export default defineNuxtConfig({
compatibilityDate: '2025-06-06',
Expand All @@ -23,22 +34,26 @@ export default defineNuxtConfig({
},
},
nitro: {
...(cloudflare && {
preset: 'cloudflare_module',
cloudflare: { nodeCompat: true, deployConfig: false },
// Sets up the SDK on Cloudflare, where the Nitro preset does not use `sentry.server.config.ts`.
plugins: ['~~/cloudflare/sentry.ts'],
Comment thread
sentry-junior[bot] marked this conversation as resolved.
Resolved
// The bundled `mysql` driver pulls in `readable-stream`, whose base `require('stream')` has no
// usable prototype under Nitro's unenv polyfill (throws `superCtor.prototype ... undefined`).
// Alias it to workerd's native `node:stream`, which has a real `Readable`.
alias: { 'readable-stream': 'node:stream' },
}),
// Files for one runtime replace their counterpart in the copy of the app for that runtime, see
// dev-packages/e2e-tests/README.md, and are no routes of their own.
ignore: ['**/*.cloudflare.ts'],
experimental: {
database: true,
},
database: {
default: {
connector: 'sqlite',
options: { name: 'db' },
},
users: {
connector: 'sqlite',
options: { name: 'users_db' },
},
analytics: {
connector: 'sqlite',
options: { name: 'analytics_db' },
},
default: database('db', 'DB'),
users: database('users_db', 'USERS_DB'),
analytics: database('analytics_db', 'ANALYTICS_DB'),
},
storage: {
'test-storage': {
Expand Down
Loading
Loading