Skip to content

Commit

Permalink
Merge pull request #329 from NIAEFEUP/chore/sentry-disabled-dev-default
Browse files Browse the repository at this point in the history
chore: sentry tracing report disabled by default in dev mode
  • Loading branch information
tomaspalma authored Oct 31, 2024
2 parents 9a13f45 + 39115ab commit 24fb9b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ VITE_APP_SEMESTER=
VITE_APP_SITE_TITLE=
VITE_APP_BACKEND_URL=

VITE_APP_SENTRY_DSN=https://[email protected]/4507775325437952
VITE_APP_SENTRY_TRACING=0

# To upload source maps to Sentry (Optional)
SENTRY_AUTH_TOKEN=
APP_SENTRY_AUTH_TOKEN=
12 changes: 6 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ const App = () => {
// Enable Error Tracking, Performance Monitoring and Session Replay
Sentry.init({
environment: Number(import.meta.env.VITE_APP_PROD) ? "production" : "development",
dsn: "https://[email protected]/4507775325437952",
dsn: import.meta.env.VITE_APP_SENTRY_DSN,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
Sentry.reactRouterV6BrowserTracingIntegration({
import.meta.env.VITE_APP_SENTRY_TRACING ? Sentry.browserTracingIntegration() : null,
import.meta.env.VITE_APP_SENTRY_TRACING ? Sentry.replayIntegration() : null,
import.meta.env.VITE_APP_SENTRY_TRACING ? Sentry.reactRouterV6BrowserTracingIntegration({
useEffect: React.useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
}),
}) : null,
],

// Performance monitoring
Expand All @@ -71,7 +71,7 @@ const App = () => {
<Layout location={page.location} title={page.location} liquid={page.liquid}>
<div>
<page.element />
<Toaster/>
<Toaster />
</div>
</Layout>
}
Expand Down

0 comments on commit 24fb9b0

Please sign in to comment.