diff --git a/config/env/default.js b/config/env/default.js index 552414bc34..606c58e98c 100644 --- a/config/env/default.js +++ b/config/env/default.js @@ -227,6 +227,7 @@ module.exports = { enabled: false, options: { dsn: '', + // Note: integrations are defined directly at `Sentry.init()`, don't add them here. }, }, // Webpack bundle analyzer diff --git a/config/lib/app.js b/config/lib/app.js index 128295b802..1d8ad369e0 100644 --- a/config/lib/app.js +++ b/config/lib/app.js @@ -6,9 +6,13 @@ const mongoose = require('./mongoose'); const express = require('./express'); const chalk = require('chalk'); const Sentry = require('@sentry/node'); +const Tracing = require('@sentry/tracing'); if (config.sentry.enabled) { - Sentry.init(config.sentry.options); + Sentry.init({ + ...config.sentry.options, + integrations: [new Tracing.Integrations.Mongo({ useMongoose: true })], + }); } // Initialize Models @@ -78,6 +82,12 @@ module.exports.start = function start(callback) { : 'off'), ), ); + console.log( + chalk.green( + 'Sentry:\t\t' + + (config.sentry && config.sentry.enabled === true ? 'on' : 'off'), + ), + ); // Reset console color console.log(chalk.white('--')); diff --git a/package.json b/package.json index d27fa5ddf6..40c23ec961 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "@sentry/browser": "6.2.5", "@sentry/integrations": "6.2.5", "@sentry/node": "6.2.5", + "@sentry/tracing": "6.2.5", "acl": "0.4.11", "agenda": "1.0.3", "angular": "1.6.10",