mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 04:32:35 +01:00
Sentry stuff?
This commit is contained in:
parent
28787e09e9
commit
45aadf327d
175
package-lock.json
generated
175
package-lock.json
generated
@ -11,8 +11,9 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.178.0",
|
||||
"@sentry/node": "^7.13.0",
|
||||
"@sentry/tracing": "^7.13.0",
|
||||
"@sentry/integrations": "^7.17.2",
|
||||
"@sentry/node": "^7.17.2",
|
||||
"@sentry/tracing": "^7.17.2",
|
||||
"ajv": "^8.6.2",
|
||||
"ajv-formats": "^2.1.1",
|
||||
"amqplib": "^0.10.3",
|
||||
@ -1428,13 +1429,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@sentry/core": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.13.0.tgz",
|
||||
"integrity": "sha512-hB46fklmKrSDMEvZOF8qBHhys7PONBFyxQtbNDZUlv/kabs4gF3VEg1ftCaXnjx4lLNlsUl/ScFdM6194RvISg==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.17.2.tgz",
|
||||
"integrity": "sha512-mBFjngWJPN3V1A/tz/qa1jkQvmZtU07hhlWg+kmajD0nFulPHUWEvZhsi8NFveGcxMxc/wmaSSLcEOpKq5L29g==",
|
||||
"dependencies": {
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"engines": {
|
||||
@ -1446,33 +1446,33 @@
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"node_modules/@sentry/hub": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.13.0.tgz",
|
||||
"integrity": "sha512-88/GsD1BoyrBwRKJCmVHZtSH5rizOsImUHWEXc1AOa1aR8nanfn56JdAbd6tC55pA+nT4R4H4vN/PrUaomTbtg==",
|
||||
"node_modules/@sentry/integrations": {
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.17.2.tgz",
|
||||
"integrity": "sha512-xHS5AK3YOpFIlCWX3rSfxwNUJ/lOKSXU0vx+AI0PAGJFNK4KEu47SKthhq1AArVr3jqFjcy3ZV5+XTjxbzydAA==",
|
||||
"dependencies": {
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"localforage": "^1.8.1",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@sentry/hub/node_modules/tslib": {
|
||||
"node_modules/@sentry/integrations/node_modules/tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"node_modules/@sentry/node": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.13.0.tgz",
|
||||
"integrity": "sha512-uP3bPAIRHPilnOEiYGQQDLaQphc/c7d87wm91bZrTJ+WPnMW4D/NmT7fna5zGGDQIr/KTdQ/LEpDeZOILbkCqQ==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.17.2.tgz",
|
||||
"integrity": "sha512-dMHff7C3MgKpIlbLkrEEtq1nX8o1Tiax/DWOtj5dLrPMsjQyivMs906GeS3GJkX7YeMMfy93j8gC+qIK54gqFw==",
|
||||
"dependencies": {
|
||||
"@sentry/core": "7.13.0",
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/core": "7.17.2",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"cookie": "^0.4.1",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"lru_map": "^0.3.3",
|
||||
@ -1496,13 +1496,13 @@
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"node_modules/@sentry/tracing": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.13.0.tgz",
|
||||
"integrity": "sha512-/MKSd25rGv6Pc0FPBLXJifkfvSaYVPA8XUOLzVeDN0gl07h8AXli4qG9amTh/4Wb5h4dFpbcscOvW2VC+pxkIA==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.17.2.tgz",
|
||||
"integrity": "sha512-j9I/g6SMkQjMPrBdzYQJSDk0qc30LJ9wZl6uKXes7dpfASq+IPcRdkPyRc5ZZX6HD/iUAlaCrBKNmYsK4+I5aw==",
|
||||
"dependencies": {
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/core": "7.17.2",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"engines": {
|
||||
@ -1515,19 +1515,19 @@
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"node_modules/@sentry/types": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.13.0.tgz",
|
||||
"integrity": "sha512-ttckM1XaeyHRLMdr79wmGA5PFbTGx2jio9DCD/mkEpSfk6OGfqfC7gpwy7BNstDH/VKyQj/lDCJPnwvWqARMoQ==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.17.2.tgz",
|
||||
"integrity": "sha512-zxhNQ8Xt/hfP8bFZEV66ovJZK7aUqok5w1wjsHgkUz/S6/gkiMrDYT3OtRCRuY3mfQu9KmeBniM0xZkaxREJ1w==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@sentry/utils": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.13.0.tgz",
|
||||
"integrity": "sha512-jnR85LgRLSk7IQe2OhKOPMY4fasJCNQNW0iCXsH+S2R1qnsF+N4ksNkQ+7JyyM9E7F03YpI2qd76bKY0VIn5iA==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.17.2.tgz",
|
||||
"integrity": "sha512-l8t6qzyi+UUzD0a/oOYn4i+Eii+Ei29/TVwj/+9ogfJzBk6dSwSLvXievsyCRpcN3tftpWP0cHREcbZN64ZOWw==",
|
||||
"dependencies": {
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"engines": {
|
||||
@ -3696,6 +3696,11 @@
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="
|
||||
},
|
||||
"node_modules/imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
@ -3921,6 +3926,22 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lie": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
|
||||
"integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",
|
||||
"dependencies": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/localforage": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
|
||||
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
|
||||
"dependencies": {
|
||||
"lie": "3.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash.includes": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
||||
@ -7380,13 +7401,12 @@
|
||||
}
|
||||
},
|
||||
"@sentry/core": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.13.0.tgz",
|
||||
"integrity": "sha512-hB46fklmKrSDMEvZOF8qBHhys7PONBFyxQtbNDZUlv/kabs4gF3VEg1ftCaXnjx4lLNlsUl/ScFdM6194RvISg==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.17.2.tgz",
|
||||
"integrity": "sha512-mBFjngWJPN3V1A/tz/qa1jkQvmZtU07hhlWg+kmajD0nFulPHUWEvZhsi8NFveGcxMxc/wmaSSLcEOpKq5L29g==",
|
||||
"requires": {
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -7397,13 +7417,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@sentry/hub": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-7.13.0.tgz",
|
||||
"integrity": "sha512-88/GsD1BoyrBwRKJCmVHZtSH5rizOsImUHWEXc1AOa1aR8nanfn56JdAbd6tC55pA+nT4R4H4vN/PrUaomTbtg==",
|
||||
"@sentry/integrations": {
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.17.2.tgz",
|
||||
"integrity": "sha512-xHS5AK3YOpFIlCWX3rSfxwNUJ/lOKSXU0vx+AI0PAGJFNK4KEu47SKthhq1AArVr3jqFjcy3ZV5+XTjxbzydAA==",
|
||||
"requires": {
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"localforage": "^1.8.1",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -7415,14 +7436,13 @@
|
||||
}
|
||||
},
|
||||
"@sentry/node": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.13.0.tgz",
|
||||
"integrity": "sha512-uP3bPAIRHPilnOEiYGQQDLaQphc/c7d87wm91bZrTJ+WPnMW4D/NmT7fna5zGGDQIr/KTdQ/LEpDeZOILbkCqQ==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.17.2.tgz",
|
||||
"integrity": "sha512-dMHff7C3MgKpIlbLkrEEtq1nX8o1Tiax/DWOtj5dLrPMsjQyivMs906GeS3GJkX7YeMMfy93j8gC+qIK54gqFw==",
|
||||
"requires": {
|
||||
"@sentry/core": "7.13.0",
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/core": "7.17.2",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"cookie": "^0.4.1",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"lru_map": "^0.3.3",
|
||||
@ -7442,13 +7462,13 @@
|
||||
}
|
||||
},
|
||||
"@sentry/tracing": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.13.0.tgz",
|
||||
"integrity": "sha512-/MKSd25rGv6Pc0FPBLXJifkfvSaYVPA8XUOLzVeDN0gl07h8AXli4qG9amTh/4Wb5h4dFpbcscOvW2VC+pxkIA==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.17.2.tgz",
|
||||
"integrity": "sha512-j9I/g6SMkQjMPrBdzYQJSDk0qc30LJ9wZl6uKXes7dpfASq+IPcRdkPyRc5ZZX6HD/iUAlaCrBKNmYsK4+I5aw==",
|
||||
"requires": {
|
||||
"@sentry/hub": "7.13.0",
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/utils": "7.13.0",
|
||||
"@sentry/core": "7.17.2",
|
||||
"@sentry/types": "7.17.2",
|
||||
"@sentry/utils": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -7460,16 +7480,16 @@
|
||||
}
|
||||
},
|
||||
"@sentry/types": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.13.0.tgz",
|
||||
"integrity": "sha512-ttckM1XaeyHRLMdr79wmGA5PFbTGx2jio9DCD/mkEpSfk6OGfqfC7gpwy7BNstDH/VKyQj/lDCJPnwvWqARMoQ=="
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.17.2.tgz",
|
||||
"integrity": "sha512-zxhNQ8Xt/hfP8bFZEV66ovJZK7aUqok5w1wjsHgkUz/S6/gkiMrDYT3OtRCRuY3mfQu9KmeBniM0xZkaxREJ1w=="
|
||||
},
|
||||
"@sentry/utils": {
|
||||
"version": "7.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.13.0.tgz",
|
||||
"integrity": "sha512-jnR85LgRLSk7IQe2OhKOPMY4fasJCNQNW0iCXsH+S2R1qnsF+N4ksNkQ+7JyyM9E7F03YpI2qd76bKY0VIn5iA==",
|
||||
"version": "7.17.2",
|
||||
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.17.2.tgz",
|
||||
"integrity": "sha512-l8t6qzyi+UUzD0a/oOYn4i+Eii+Ei29/TVwj/+9ogfJzBk6dSwSLvXievsyCRpcN3tftpWP0cHREcbZN64ZOWw==",
|
||||
"requires": {
|
||||
"@sentry/types": "7.13.0",
|
||||
"@sentry/types": "7.17.2",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -9160,6 +9180,11 @@
|
||||
"queue": "6.0.2"
|
||||
}
|
||||
},
|
||||
"immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="
|
||||
},
|
||||
"imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
@ -9353,6 +9378,22 @@
|
||||
"type-check": "~0.3.2"
|
||||
}
|
||||
},
|
||||
"lie": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
|
||||
"integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",
|
||||
"requires": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"localforage": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
|
||||
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
|
||||
"requires": {
|
||||
"lie": "3.1.1"
|
||||
}
|
||||
},
|
||||
"lodash.includes": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
||||
|
@ -49,8 +49,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.178.0",
|
||||
"@sentry/node": "^7.13.0",
|
||||
"@sentry/tracing": "^7.13.0",
|
||||
"@sentry/integrations": "^7.17.2",
|
||||
"@sentry/node": "^7.17.2",
|
||||
"@sentry/tracing": "^7.17.2",
|
||||
"ajv": "^8.6.2",
|
||||
"ajv-formats": "^2.1.1",
|
||||
"amqplib": "^0.10.3",
|
||||
|
@ -10,6 +10,7 @@ import { green, bold, yellow } from "picocolors";
|
||||
import { Config, initDatabase, BannedWords } from "@fosscord/util";
|
||||
import * as Sentry from "@sentry/node";
|
||||
import * as Tracing from "@sentry/tracing";
|
||||
import * as Integrations from "@sentry/integrations";
|
||||
|
||||
const app = express();
|
||||
const server = http.createServer();
|
||||
@ -73,6 +74,9 @@ async function main() {
|
||||
new Sentry.Integrations.Http({ tracing: true }),
|
||||
new Tracing.Integrations.Express({ app }),
|
||||
new Tracing.Integrations.Mysql(),
|
||||
new Integrations.RewriteFrames({
|
||||
root: __dirname,
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: Config.get().sentry.traceSampleRate,
|
||||
environment: Config.get().sentry.environment,
|
||||
|
@ -42,22 +42,25 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const transaction = Sentry.startTransaction({
|
||||
const transaction = data.op != 1 ? Sentry.startTransaction({
|
||||
op: OPCODES[data.op],
|
||||
name: `GATEWAY ${OPCODES[data.op]}`,
|
||||
data: {
|
||||
...data.d,
|
||||
token: data?.d?.token ? "[Redacted]" : undefined,
|
||||
},
|
||||
});
|
||||
}) : undefined;
|
||||
|
||||
try {
|
||||
var ret = await OPCodeHandler.call(this, data);
|
||||
transaction.finish();
|
||||
transaction?.finish();
|
||||
return ret;
|
||||
} catch (error) {
|
||||
Sentry.captureException(error);
|
||||
transaction.finish();
|
||||
Sentry.withScope((scope) => {
|
||||
scope.setSpan(transaction);
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
transaction?.finish();
|
||||
console.error(`Error: Op ${data.op}`, error);
|
||||
// if (!this.CLOSED && this.CLOSING)
|
||||
return this.close(CLOSECODES.Unknown_error);
|
||||
|
Loading…
Reference in New Issue
Block a user