Skip to content
Permalink
Browse files

Configure the environment option with Sentry (#4047)

* configure the environment option with Sentry

* Update webpack.config.js

Co-Authored-By: Lucie <lucie.daeye@gmail.com>
  • Loading branch information
cadecairos and patjouk committed Dec 12, 2019
1 parent cdc87cd commit fe8720c131b503a4dab3a617841c158890f90b81
Showing with 9 additions and 3 deletions.
  1. +1 −0 env.default
  2. +4 −1 network-api/networkapi/settings.py
  3. +2 −1 source/js/main.js
  4. +2 −1 webpack.config.js
@@ -79,3 +79,4 @@ CLOUDINARY_API_SECRET=
# Sentry
SENTRY_DSN=
HEROKU_RELEASE_VERSION=
SENTRY_ENVIRONMENT=
@@ -80,6 +80,7 @@
# Sentry
SENTRY_DSN=(str, None),
HEROKU_RELEASE_VERSION=(str, None),
SENTRY_ENVIRONMENT=(str, None),
REVIEW_APP=(bool, False),
)

@@ -91,14 +92,16 @@

SENTRY_DSN = env('SENTRY_DSN')
HEROKU_RELEASE_VERSION = env('HEROKU_RELEASE_VERSION')
SENTRY_ENVIRONMENT = env('SENTRY_ENVIRONMENT')

if SENTRY_DSN:
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
release=HEROKU_RELEASE_VERSION
release=HEROKU_RELEASE_VERSION,
environment=SENTRY_ENVIRONMENT
)

# At True when running on a review app
@@ -24,7 +24,8 @@ const SHOW_MEMBER_NOTICE = false;
// Initialize Sentry error reporting
Sentry.init({
dsn: __SENTRY_DSN__,
release: __HEROKU_RELEASE_VERSION__
release: __HEROKU_RELEASE_VERSION__,
environment: __SENTRY_ENVIRONMENT__
});

// To be populated via XHR and querySelector
@@ -36,7 +36,8 @@ let main = {
__SENTRY_DSN__: JSON.stringify(process.env.SENTRY_DSN),
__HEROKU_RELEASE_VERSION__: JSON.stringify(
process.env.HEROKU_RELEASE_VERSION
)
),
__SENTRY_ENVIRONMENT__: JSON.stringify(process.env.SENTRY_ENVIRONMENT)
})
]
};

0 comments on commit fe8720c

Please sign in to comment.
You can’t perform that action at this time.