Add Sentry dev probe and observability smoke test.

GET /api/debug/sentry, load .env.local for DSN, Playwright observability spec.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mauricio Barragan
2026-06-12 10:38:08 -06:00
parent e04f3977c6
commit 8c7127cfde
6 changed files with 30 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
import "./load-env.js";
import { initInstrumentation } from "./instrumentation/index.js";
initInstrumentation();
+10
View File
@@ -4,6 +4,7 @@ import {
type Request,
type Response,
} from "express";
import { Sentry } from "../../instrumentation/sentry.js";
import type { ApplicationService } from "../../composition/application-service.js";
import {
bindRequestCorrelation,
@@ -39,6 +40,15 @@ export function createRouter(app: ApplicationService, sse: SseHub): Router {
res.json({ success: true, data: { status: "ok", ts: Date.now() } });
});
router.get("/debug/sentry", (_req: Request, res: Response) => {
if (process.env.NODE_ENV === "production") {
res.status(404).json({ error: "Not found" });
return;
}
Sentry.captureException(new Error("Arb Pulse Sentry test error"));
res.json({ ok: true, message: "Test error sent to Sentry" });
});
router.get("/state", async (_req: Request, res: Response) => {
const cached =
await getCachedSnapshot<ReturnType<ApplicationService["getSnapshot"]>>();
+9
View File
@@ -0,0 +1,9 @@
import { existsSync } from "node:fs";
import { loadEnvFile } from "node:process";
for (const file of [".env.local", ".env"]) {
if (existsSync(file)) {
loadEnvFile(file);
break;
}
}