feat(CF-2136): Add Sentry structured logging support

Enable enableLogs + beforeSendLog in Sentry.init, add log helpers where
applicable. Bump @sentry/node to ^10.39.0 for Sentry.logger API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-03-04 10:38:48 +02:00
parent a6fcf2cefa
commit 8b9ff93cfb
3 changed files with 2665 additions and 2 deletions

2658
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,8 +14,8 @@
"author": "Agiliton",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.4"
"@sentry/node": "^9.19.1",
"@modelcontextprotocol/sdk": "^1.0.4",
"@sentry/node": "^10.39.0"
},
"devDependencies": {
"@types/node": "^20.11.0",

View File

@@ -19,6 +19,11 @@ if (process.env.SENTRY_DSN) {
dsn: process.env.SENTRY_DSN,
environment: process.env.SENTRY_ENVIRONMENT || "production",
tracesSampleRate: parseFloat(process.env.SENTRY_API_TRACE_RATE || "0.1"),
enableLogs: true,
beforeSendLog(log) {
if (log.level === "debug") return null;
return log;
},
});
}