feat(sentry): add wip sentry integration on server side

This commit is contained in:
Taso committed 2021-07-27 17:06:52 -04:00
1 parent 4b724dfa73
commit 02f0abd761
10 files changed
+330 -64

No files matched your search

+16
View File
@@ -1,5 +1,6 @@
import { Server } from 'esx.js';
import { ResourceConfig } from '../../typings/config';
import { RewriteFrames } from '@sentry/integrations';
// Setup and export config loaded at runtime
export const config: ResourceConfig = JSON.parse(
@@ -21,6 +22,21 @@ import './bank/bank.controller';
import './sv_main';
import { mainLogger } from './sv_logger';
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
// Setup sentry tracing
if (config.debug.sentryEnabled && process.env.NODE_ENV === 'production') {
Sentry.init({
dsn: 'https://[email protected]/3',
integrations: [new RewriteFrames()],
release: process.env.SENTRY_RELEASE || '0.0.0',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
}
export let ESX: Server = null;
+1
View File
@@ -12,6 +12,7 @@
"lib": ["es2015", "DOM"],
"types": ["@citizenfx/server", "@types/node", "jest"],
"moduleResolution": "node",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true
},