postio / apps /backend /dist /libraries /nestjs-libraries /src /sentry /initialize.sentry.js
Leon4gr45's picture
Upload folder using huggingface_hub (part 4)
3722089 verified
Raw
History Blame Contribute Delete
1.74 kB
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeSentry = void 0;
const tslib_1 = require("tslib");
const Sentry = tslib_1.__importStar(require("@sentry/nestjs"));
const profiling_node_1 = require("@sentry/profiling-node");
const lodash_1 = require("lodash");
const initializeSentry = (appName, allowLogs = false) => {
if (!process.env.NEXT_PUBLIC_SENTRY_DSN) {
return null;
}
try {
Sentry.init({
initialScope: {
tags: {
service: appName,
component: 'nestjs',
},
contexts: {
app: {
name: `Postiz ${(0, lodash_1.capitalize)(appName)}`,
},
},
},
environment: process.env.NODE_ENV || 'development',
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
spotlight: process.env.SENTRY_SPOTLIGHT === '1',
integrations: [
(0, profiling_node_1.nodeProfilingIntegration)(),
Sentry.consoleLoggingIntegration({ levels: ['log', 'info', 'warn', 'error', 'debug', 'assert', 'trace'] }),
Sentry.openAIIntegration({
recordInputs: true,
recordOutputs: true,
}),
],
tracesSampleRate: 1.0,
enableLogs: true,
profileSessionSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.45,
profileLifecycle: 'trace',
});
}
catch (err) {
console.log(err);
}
return true;
};
exports.initializeSentry = initializeSentry;
//# sourceMappingURL=initialize.sentry.js.map