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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,