Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update web client sentry config #1580

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ src/terrasoApi/shared/graphqlSchema

# Sentry Config File
.sentryclirc

# Sentry Config File
.sentryclirc
2 changes: 1 addition & 1 deletion local.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ REACT_APP_PLAUSIBLE_DOMAIN=app.local.terraso.org
REACT_APP_SHARED_DATA_ACCEPTED_EXTENSIONS=csv,doc,docx,pdf,ppt,pptx,xlsx,xls
REACT_APP_IMAGE_ACCEPTED_EXTENSIONS=jpeg,jpg
REACT_APP_MAPBOX_ACCESS_TOKEN=
REACT_APP_SENTRY_DSN=https://[email protected]/abcd
SENTRY_AUTH_TOKEN=sntrys_eyxxxxxxxxxxx
SENTRY_DSN=https://[email protected]/abcd
179 changes: 90 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@mui/material": "^5.15.3",
"@mui/x-data-grid": "^6.19.1",
"@reduxjs/toolkit": "^1.9.7",
"@sentry/cli": "^2.22.3",
"@sentry/react": "^7.102.1",
"@sentry/cli": "^2.28.6",
"@sentry/react": "^7.103.0",
"@turf/bbox": "^6.5.0",
"@turf/center": "^6.5.0",
"@turf/helpers": "^6.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const COOKIES_DOMAIN =

const COOKIES_PARAMS = { path: '/', domain: COOKIES_DOMAIN };

export const SENTRY_DSN = process.env.SENTRY_DSN;
export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN || '';

setAPIConfig({
terrasoAPIURL: TERRASO_API_URL,
Expand Down
26 changes: 17 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,25 @@ Sentry.init({
dsn: SENTRY_DSN,
environment: TERRASO_ENV,
integrations: [
new Sentry.BrowserTracing({
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
// See docs for support of different versions of variation of react router
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
Sentry.reactRouterV6BrowserTracingIntegration({
useEffect: React.useEffect,
}),
new Sentry.Replay(),
Sentry.replayIntegration(),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.

// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
tracesSampleRate: 1.0,

// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['127.0.0.1', /^https:\/\/terraso\.org/],

// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});

createRoot(document.getElementById('root')).render(
Expand Down
Loading