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
6 changes: 6 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ Affected SDKs: `@sentry/node` and all dependents.

The new channel-based instrumentations (using `orchestrion` instead of `import-in-the-middle`) are now the default. They were available opt-in in v10. This unlocks instrumenting at run and build time, which enables instrumentation at deployment targets like Vercel and Netlify, as well as using instrumentations on non-Node runtimes like Cloudflare, Bun and Deno. For most users this requires no changes.

### `setupHapiErrorHandler` is deprecated (Hapi errors are captured automatically)

Affected SDKs: `@sentry/node` and all dependents that re-export it (e.g. `@sentry/aws-serverless`, `@sentry/google-cloud-serverless`, `@sentry/astro`, `@sentry/remix`, `@sentry/solidstart`, `@sentry/sveltekit`, `@sentry/bun`, `@sentry/elysia`).

The Hapi error handler is now registered automatically when your server starts, so you no longer need to call `setupHapiErrorHandler` yourself. The function is deprecated and will be removed in a future major version; you should no longer call it.

### Initializing via `--require` is no longer supported

Affected SDKs: `@sentry/node` and all dependents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ const init = async () => {

(async () => {
init();
await Sentry.setupHapiErrorHandler(server);
await server.start();
console.log('Server running on %s', server.info.uri);
})();
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Boom from '@hapi/boom';
import Hapi from '@hapi/hapi';
import * as Sentry from '@sentry/node';
import { sendPortToRunner } from '@sentry-internal/node-integration-tests';

const port = 5999;
Expand Down Expand Up @@ -67,7 +66,6 @@ const run = async () => {
// Server extension produces a `middleware` span.
server.ext('onPreResponse', (request, h) => h.continue);

await Sentry.setupHapiErrorHandler(server);
await server.start();

sendPortToRunner(port);
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export {
setAttribute,
setAttributes,
setupExpressErrorHandler,
// oxlint-disable-next-line typescript/no-deprecated
setupHapiErrorHandler,
setupKoaErrorHandler,
setUser,
Expand Down
1 change: 1 addition & 0 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export {
childProcessIntegration,
createSentryWinstonTransport,
hapiIntegration,
// oxlint-disable-next-line typescript/no-deprecated
setupHapiErrorHandler,
spotlightIntegration,
initOpenTelemetry,
Expand Down
1 change: 1 addition & 0 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export {
getOtlpTracesEndpoint,
processSessionIntegration,
hapiIntegration,
// oxlint-disable-next-line typescript/no-deprecated
setupHapiErrorHandler,
spotlightIntegration,
initOpenTelemetry,
Expand Down
1 change: 1 addition & 0 deletions packages/elysia/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export {
prismaIntegration,
processSessionIntegration,
hapiIntegration,
// oxlint-disable-next-line typescript/no-deprecated
setupHapiErrorHandler,
spotlightIntegration,
initOpenTelemetry,
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export {
getOtlpTracesEndpoint,
processSessionIntegration,
hapiIntegration,
// oxlint-disable-next-line typescript/no-deprecated
setupHapiErrorHandler,
spotlightIntegration,
initOpenTelemetry,
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export {
instrumentStateGraph,
instrumentStateGraphCompile,
} from '@sentry/server-utils';
// oxlint-disable-next-line typescript/no-deprecated
export { setupHapiErrorHandler } from './integrations/tracing/hapi';
export { setupKoaErrorHandler } from './integrations/tracing/koa';
export {
Expand Down
17 changes: 17 additions & 0 deletions packages/node/src/integrations/tracing/hapi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { attachHapiErrorHandler } from '@sentry/server-utils';

/**
* Add a Hapi plugin to capture errors to Sentry.
*
* @deprecated The error handler is now registered automatically when the Hapi
* server starts (via the orchestrion `@hapi/hapi` instrumentation), so calling
* this is no longer necessary. It remains a safe, idempotent operation when the
* handler is already attached, and is kept for setups where auto-registration is
* unavailable. This will be removed in a future major version.
*
* @param server The Hapi server to attach the error handler to
*/
export async function setupHapiErrorHandler(server: unknown): Promise<void> {
// oxlint-disable-next-line typescript/no-deprecated
attachHapiErrorHandler(server as Parameters<typeof attachHapiErrorHandler>[0]);
}
66 changes: 0 additions & 66 deletions packages/node/src/integrations/tracing/hapi/index.ts

This file was deleted.

226 changes: 0 additions & 226 deletions packages/node/src/integrations/tracing/hapi/types.ts

This file was deleted.

Loading
Loading