Skip to content
Open
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ Work in this release was contributed by @adityareddy-dev, @jpdefo, @Jxxunnn, @ph

`ignoreStaticAssets` defaults to `true`, so workers no longer create spans for `GET` requests to common static assets such as `favicon.ico`, `robots.txt` or `*.js` files. To keep these spans, set `httpServerIntegration({ ignoreStaticAssets: false })`. Request spans also follow the client's tracing configuration by default, so the SDK does not start them when tracing is disabled. If `ignoreRequestBody` throws, the request no longer fails, and the SDK skips the body.

- **feat(node, bun, deno, cloudflare): Align portable exports across server SDKs**

Node, Bun, Deno and Cloudflare now export the same helpers from `@sentry/core` and `@sentry/server-utils` where they work on that runtime:

- Node and Bun now export `moduleMetadataIntegration`, `instrumentPostgresJsSql`, `instrumentCreateReactAgent`, `awsIntegration` and the `FlueOptions` type. `awsIntegration` was already in their default integrations.
- Deno and Cloudflare now export `parameterize` and `instrumentStateGraphCompile`.
- Bun and Cloudflare now export the `Log` and `LogSeverityLevel` types.
- Deno now exports `fastifyIntegration`, which was already in its default integrations.

## 11.8.0

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

interface Env {
SENTRY_DSN: string;
}

// A plain worker. The `@sentry/cloudflare/vite` plugin wraps it with `withSentry` at build time,
// with the options from `instrument.server.ts`.
export default {
async fetch(): Promise<Response> {
const userId = 42;
Sentry.captureMessage(Sentry.parameterize`User ${userId} logged in`);
return new Response('ok');
},
} satisfies ExportedHandler<Env>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineCloudflareOptions } from '@sentry/cloudflare';

export default defineCloudflareOptions((env: { SENTRY_DSN: string }) => ({
dsn: env.SENTRY_DSN,
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Event } from '@sentry/core';
import { expect, it } from 'vitest';
import { createRunner } from '../../../runner';

it('parameterize from the public entry sends a message template and its values', async ({ signal }) => {
const runner = createRunner(__dirname)
.expect(envelope => {
const event = envelope[1]?.[0]?.[1] as Event;
expect(event.logentry).toEqual({ message: 'User %s logged in', params: [42] });
})
.start(signal);

await runner.makeRequest('get', '/');
await runner.completed();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { cloudflare } from '@cloudflare/vite-plugin';
import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [cloudflare(), sentryCloudflareVitePlugin()],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../../node_modules/wrangler/config-schema.json",
"name": "cloudflare-public-api-parameterize",
// `main` points at the source entry. The Sentry Vite plugin builds from it, and the runner serves
// the built output.
"main": "index.ts",
"compatibility_date": "2025-06-17",
"compatibility_flags": ["nodejs_compat"],
}
25 changes: 25 additions & 0 deletions dev-packages/deno-integration-tests/suites/parameterize/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <reference lib="deno.ns" />

import * as Sentry from '@sentry/deno';
import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts';
import { errorSink, resetGlobals, withTimeout } from '../../src/index.ts';

Deno.test('parameterize from the public entry sends a message template and its values', async () => {
resetGlobals();
const sink = errorSink();

Sentry.init({
dsn: 'https://username@domain/123',
beforeSend: sink.beforeSend,
});

const userId = 42;
Sentry.captureMessage(Sentry.parameterize`User ${userId} logged in`);

const event = await withTimeout(
sink.waitFor(e => e.logentry?.message === 'User %s logged in'),
5_000,
'parameterized message event',
);
assertEquals(event.logentry, { message: 'User %s logged in', params: [42] });
});
4 changes: 4 additions & 0 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export {
addIntegration,
amqplibIntegration,
anthropicAIIntegration,
awsIntegration,
// eslint-disable-next-line typescript/no-deprecated
anrIntegration,
googleGenAIIntegration,
Expand Down Expand Up @@ -102,6 +103,7 @@ export {
langChainIntegration,
langGraphIntegration,
createFlueInstrumentation,
instrumentPostgresJsSql,
mastraIntegration,
piDurableIntegration,
mcpServerIntegration,
Expand Down Expand Up @@ -177,6 +179,8 @@ export {
instrumentLangChainEmbeddings,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
moduleMetadataIntegration,
zodErrorsIntegration,
profiler,
logger,
Expand Down
3 changes: 3 additions & 0 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export {
addEventProcessor,
addBreadcrumb,
addIntegration,
moduleMetadataIntegration,
captureException,
captureEvent,
captureMessage,
Expand Down Expand Up @@ -71,6 +72,7 @@ export {
mcpServerIntegration,
SentryMastraExporter,
createFlueInstrumentation,
instrumentPostgresJsSql,
modulesIntegration,
nodeRuntimeMetricsIntegration,
type NodeRuntimeMetricsOptions,
Expand Down Expand Up @@ -159,6 +161,7 @@ export {
instrumentGoogleGenAIClient,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
6 changes: 6 additions & 0 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type {
Exception,
Session,
SeverityLevel,
Log,
LogSeverityLevel,
Span,
StackFrame,
Stacktrace,
Expand All @@ -25,6 +27,7 @@ export {
addEventProcessor,
addBreadcrumb,
addIntegration,
moduleMetadataIntegration,
captureException,
captureEvent,
captureMessage,
Expand Down Expand Up @@ -93,6 +96,7 @@ export {
mcpServerIntegration,
SentryMastraExporter,
createFlueInstrumentation,
instrumentPostgresJsSql,
modulesIntegration,
contextLinesIntegration,
nodeContextIntegration,
Expand Down Expand Up @@ -176,6 +180,8 @@ export {
instrumentGoogleGenAIClient,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
awsIntegration,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
4 changes: 4 additions & 0 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export type {
FeatureFlagsIntegration,
Session,
SeverityLevel,
Log,
LogSeverityLevel,
Span,
StackFrame,
Stacktrace,
Expand All @@ -30,6 +32,7 @@ export {
captureException,
captureEvent,
captureMessage,
parameterize,
captureFeedback,
close,
createTransport,
Expand Down Expand Up @@ -139,6 +142,7 @@ export {
createLangChainCallbackHandler,
instrumentLangChainEmbeddings,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
vercelAIIntegration,
honoIntegration,
Expand Down
3 changes: 3 additions & 0 deletions packages/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
captureException,
captureEvent,
captureMessage,
parameterize,
captureFeedback,
close,
createTransport,
Expand Down Expand Up @@ -122,6 +123,7 @@ export {
createLangChainCallbackHandler,
instrumentLangChainEmbeddings,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
} from '@sentry/server-utils';
export type { FlueOptions } from '@sentry/server-utils';
Expand Down Expand Up @@ -156,6 +158,7 @@ export {
genericPoolIntegration,
googleGenAIIntegration,
graphqlIntegration,
fastifyIntegration,
hapiIntegration,
honoIntegration,
honoMiddleware,
Expand Down
4 changes: 4 additions & 0 deletions packages/deno/test/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const EXPECTED_FUNCTION_EXPORTS = [
'createConsolaReporter',
'growthbookIntegration',
'moduleMetadataIntegration',
'parameterize',
// @sentry/core/server
'trpcMiddleware',
// @sentry/server-utils
Expand All @@ -24,7 +25,10 @@ const EXPECTED_FUNCTION_EXPORTS = [
'createLangChainCallbackHandler',
'instrumentLangChainEmbeddings',
'instrumentStateGraph',
'instrumentStateGraphCompile',
'instrumentCreateReactAgent',
// In the default integrations, so users who set `defaultIntegrations` can add it back
'fastifyIntegration',
Comment thread
cursor[bot] marked this conversation as resolved.
// ./sdk
'initWithoutDefaultIntegrations',
'getDefaultIntegrationsWithoutPerformance',
Expand Down
4 changes: 4 additions & 0 deletions packages/google-cloud-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export {
addEventProcessor,
addBreadcrumb,
addIntegration,
moduleMetadataIntegration,
captureException,
captureEvent,
captureMessage,
Expand Down Expand Up @@ -71,6 +72,7 @@ export {
mcpServerIntegration,
SentryMastraExporter,
createFlueInstrumentation,
instrumentPostgresJsSql,
modulesIntegration,
nodeRuntimeMetricsIntegration,
type NodeRuntimeMetricsOptions,
Expand Down Expand Up @@ -156,6 +158,8 @@ export {
instrumentGoogleGenAIClient,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
awsIntegration,
zodErrorsIntegration,
profiler,
amqplibIntegration,
Expand Down
4 changes: 4 additions & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export { expressErrorHandler, setupExpressErrorHandler } from '@sentry/server-ut
export {
amqplibIntegration,
anthropicAIIntegration,
awsIntegration,
dataloaderIntegration,
expressIntegration,
type ExpressIntegrationOptions,
Expand Down Expand Up @@ -57,6 +58,8 @@ export {
instrumentLangChainEmbeddings,
instrumentStateGraph,
instrumentStateGraphCompile,
instrumentCreateReactAgent,
instrumentPostgresJsSql,
Comment thread
cursor[bot] marked this conversation as resolved.
fastifyIntegration,
// oxlint-disable-next-line typescript/no-deprecated
setupFastifyErrorHandler,
Expand Down Expand Up @@ -148,6 +151,7 @@ export {
captureSession,
endSession,
addIntegration,
moduleMetadataIntegration,
startSpan,
startSpanManual,
startInactiveSpan,
Expand Down
Loading