diff --git a/lib/external/sentry.js b/lib/external/sentry.js index 87bbe2013..677cfd885 100644 --- a/lib/external/sentry.js +++ b/lib/external/sentry.js @@ -8,7 +8,7 @@ // except according to the terms contained in the LICENSE file. const { inspect } = require('util'); -const { isBlank } = require('../util/util'); +const { isBlank, isPresent } = require('../util/util'); // Endpoints where query strings are sensitive and should be removed @@ -133,6 +133,12 @@ const init = (config) => { const username = require('os').hostname(); Sentry.setUser({ username }); + if (isPresent(process.env.SENTRY_TAGS)) { + const tags = JSON.parse(process.env.SENTRY_TAGS); + for (const [key, value] of Object.entries(tags)) + Sentry.setTag(key, value); + } + return Sentry; };