mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
Integrate Sentry with Elysia
This commit is contained in:
@@ -85,8 +85,9 @@
|
||||
"@prisma/client": "^7.0.0",
|
||||
"@prisma/extension-read-replicas": "^0.5.0",
|
||||
"@prisma/instrumentation": "^7.0.0",
|
||||
"@sentry/browser": "^10.45.0",
|
||||
"@sentry/node": "^10.45.0",
|
||||
"@sentry/browser": "^10.55.0",
|
||||
"@sentry/elysia": "^10.55.0",
|
||||
"@sentry/node": "^10.55.0",
|
||||
"@sentry/rollup-plugin": "^4.6.1",
|
||||
"@simplewebauthn/server": "^13.3.0",
|
||||
"@sinclair/typebox": "^0.34.49",
|
||||
|
||||
@@ -4,6 +4,7 @@ import { NextNotFoundError } from "@/lib/runtime/navigation";
|
||||
import { parseCookieHeader, requestContextALS, type RequestContext } from "@/lib/runtime/request-context";
|
||||
import { node } from "@elysiajs/node";
|
||||
import { getEnvVariable, getNodeEnvironment } from "@hexclave/shared/dist/utils/env";
|
||||
import * as Sentry from "@sentry/elysia";
|
||||
import { Elysia } from "elysia";
|
||||
import { createBackendRequest } from "./backend-request";
|
||||
import { handleUncaughtBackendError } from "./error-handler";
|
||||
@@ -22,8 +23,12 @@ const knownHttpMethods = new Set<string>(httpMethodNames);
|
||||
const developmentRequestStartTimes = new WeakMap<Request, number>();
|
||||
const shouldLogDevelopmentRequests = getNodeEnvironment() === "development";
|
||||
|
||||
export const app = new Elysia({
|
||||
export const app = Sentry.withElysia(new Elysia({
|
||||
adapter: node(),
|
||||
}), {
|
||||
// The global backend error boundary adds location metadata before capturing errors.
|
||||
// Keep it as the single capture owner so the framework integration does not emit duplicates.
|
||||
shouldHandleError: () => false,
|
||||
})
|
||||
.onRequest(({ request }) => {
|
||||
if (shouldLogDevelopmentRequests) {
|
||||
|
||||
Generated
+475
-338
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user