feat(CF-529): Add Sentry error tracking integration
- Added @sentry/node dependency - Initialize Sentry in src/index.ts with environment variables - Supports SENTRY_DSN, SENTRY_ENVIRONMENT, SENTRY_API_TRACE_RATE
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.0.4"
|
"@modelcontextprotocol/sdk": "^1.0.4"
|
||||||
|
"@sentry/node": "^9.19.1",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.11.0",
|
"@types/node": "^20.11.0",
|
||||||
|
|||||||
11
src/index.ts
11
src/index.ts
@@ -11,6 +11,17 @@
|
|||||||
* - compressed_glob: File listing with collapsed directories
|
* - compressed_glob: File listing with collapsed directories
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as Sentry from "@sentry/node";
|
||||||
|
|
||||||
|
// Initialize Sentry for error tracking
|
||||||
|
if (process.env.SENTRY_DSN) {
|
||||||
|
Sentry.init({
|
||||||
|
dsn: process.env.SENTRY_DSN,
|
||||||
|
environment: process.env.SENTRY_ENVIRONMENT || "production",
|
||||||
|
tracesSampleRate: parseFloat(process.env.SENTRY_API_TRACE_RATE || "0.1"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
||||||
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
Reference in New Issue
Block a user