Disable Sentry inside Docker (#1781)

This commit is contained in:
Kostas Bariotis
2020-06-18 12:18:57 +01:00
committed by GitHub
parent f1ceeab8d9
commit 8f65e37dac
3 changed files with 8 additions and 7 deletions

View File

@ -27,12 +27,14 @@ const SentryEnvHostnameMap: { [key: string]: string } = {
"now.sh": "staging",
};
const onlineEnv = Object.keys(SentryEnvHostnameMap).find(
(item) => window.location.hostname.indexOf(item) >= 0,
);
// Disable Sentry locally or inside the Docker to avoid noise/respect privacy
const onlineEnv =
process.env.REACT_APP_DISABLE_SENTRY !== "true" &&
Object.keys(SentryEnvHostnameMap).find(
(item) => window.location.hostname.indexOf(item) >= 0,
);
Sentry.init({
// Disable Sentry locally to avoid noise
dsn: onlineEnv
? "https://7bfc596a5bf945eda6b660d3015a5460@sentry.io/5179260"
: undefined,