diff --git a/server/package.json b/server/package.json index 30ddce0b66..58bf329774 100644 --- a/server/package.json +++ b/server/package.json @@ -33,6 +33,8 @@ }, "devDependencies": { "@prettier/plugin-pug": "^1.13.5", + "@sentry/node": "^6.2.3", + "@sentry/tracing": "^6.2.3", "@starptech/prettyhtml": "^0.10.0", "@types/eslint": "7.2.2", "@types/eslint-scope": "^3.7.0", diff --git a/server/src/utils/sentry.ts b/server/src/utils/sentry.ts new file mode 100644 index 0000000000..0a4a9ed210 --- /dev/null +++ b/server/src/utils/sentry.ts @@ -0,0 +1,15 @@ +import * as Sentry from '@sentry/node'; +import * as Tracing from '@sentry/tracing'; + +export function startSentry() { + Sentry.init({ + dsn: 'https://9f98a5b017574d5caa20c78835f9e606@o557134.ingest.sentry.io/5689013', + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + attachStacktrace: true + }); +} diff --git a/server/src/vueServerMain.ts b/server/src/vueServerMain.ts index ba26c11f11..908f5f8f47 100644 --- a/server/src/vueServerMain.ts +++ b/server/src/vueServerMain.ts @@ -1,5 +1,8 @@ import { createConnection, InitializeParams, InitializeResult } from 'vscode-languageserver/node'; import { VLS } from './services/vls'; +import { startSentry } from './utils/sentry'; + +startSentry(); const connection = process.argv.length <= 2 ? createConnection(process.stdin, process.stdout) : createConnection(); diff --git a/server/yarn.lock b/server/yarn.lock index 850b888918..d6180a167c 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -258,6 +258,74 @@ dependencies: pug-lexer "^5.0.0" +"@sentry/core@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.2.3.tgz#ed5d21fd8b18ddc289d04c669393a437fb09639f" + integrity sha512-GpfHoSJiXchVXgyaMWVtIPVw2t97KkD1OJ4JdL3/TeH3auX5XvsN5iHTk+x/Er8t13IpOnvidH1xWdV1dnax2w== + dependencies: + "@sentry/hub" "6.2.3" + "@sentry/minimal" "6.2.3" + "@sentry/types" "6.2.3" + "@sentry/utils" "6.2.3" + tslib "^1.9.3" + +"@sentry/hub@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.2.3.tgz#07fba07627b7523f69f8b862f00cd197e5e4e5bd" + integrity sha512-D5Horfo2l0p52S7KPvy7qwWNMrE4IsCN8ODbfcCsfJu7hEXJmItbkbohIVSqO5neukhn5nu+x8kyCe9Q5u1Q6g== + dependencies: + "@sentry/types" "6.2.3" + "@sentry/utils" "6.2.3" + tslib "^1.9.3" + +"@sentry/minimal@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.2.3.tgz#462ce7739fa85fd7d6dd13d56d20f17ff91e46d0" + integrity sha512-Gpn9x4NQAG7E94EK1+hAz9GUcYrffTuqJ/XgqvHYk0jsHZ6RfsXYrmBac0ZwUxOivMf2t0n5opK0v5rhMDfF2w== + dependencies: + "@sentry/hub" "6.2.3" + "@sentry/types" "6.2.3" + tslib "^1.9.3" + +"@sentry/node@^6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.2.3.tgz#4d00902bdd0e9c8132f67726feb19c9d566e4792" + integrity sha512-MaT8Uj+dOi1FPR4GkRGoQwaqxWKtfz+KpZ2RUT+x6aMqE8nieDFKts0i7O2vALg7LbRFzVsDsvK2GWcunfYkpA== + dependencies: + "@sentry/core" "6.2.3" + "@sentry/hub" "6.2.3" + "@sentry/tracing" "6.2.3" + "@sentry/types" "6.2.3" + "@sentry/utils" "6.2.3" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@6.2.3", "@sentry/tracing@^6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.2.3.tgz#fefa55b1f2265973a747b30da14a54b779b5090e" + integrity sha512-OnQZKp7qVera+Z4ly6hgybGgyf10p2VDXqwueXkMVeLD+PwlPG8a8NMpKkZ+QxwRbQbSFhRLQaib3NX34tusBQ== + dependencies: + "@sentry/hub" "6.2.3" + "@sentry/minimal" "6.2.3" + "@sentry/types" "6.2.3" + "@sentry/utils" "6.2.3" + tslib "^1.9.3" + +"@sentry/types@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.2.3.tgz#0c06a475a51d28c73a69b05f0d43db05310ec241" + integrity sha512-BpA+9FherWgYlkMD/82bGFh/gAqZNlZX5UE8vWLKyyzNyOEEz3v9ScxE8dOSWE4v5iXJR1O3jjxaTcRQxPVgCA== + +"@sentry/utils@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.2.3.tgz#c96539571a67fb2eed56897133649f35309e3f74" + integrity sha512-YnkJm97wSvck39eRpqWjIuuwbvzPilvAcMqhbUy9yK/UBQMDGUzAKCOKH40udw1DwMUCWjJ71mOCDgUorE4Fog== + dependencies: + "@sentry/types" "6.2.3" + tslib "^1.9.3" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -1150,6 +1218,11 @@ convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +cookie@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -2134,6 +2207,14 @@ https-proxy-agent@^4.0.0: agent-base "5" debug "4" +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + ignore-walk@3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" @@ -2744,6 +2825,11 @@ lru-cache@^4.0.1, lru-cache@^4.1.5: pseudomap "^1.0.2" yallist "^2.1.2" +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -4295,7 +4381,7 @@ trough@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.3.tgz#e29bd1614c6458d44869fc28b255ab7857ef7c24" -tslib@^1.13.0: +tslib@^1.13.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==