Skip to content

Commit

Permalink
feat: Migrate Rollbar to Sentry (#2854)
Browse files Browse the repository at this point in the history
* feat: Migrate Rollbar to Sentry

* refactor: Use the default browser tracing

* Update .prettierignore

Signed-off-by: Kevin Szuchet <[email protected]>

---------

Signed-off-by: Kevin Szuchet <[email protected]>
  • Loading branch information
kevinszuchet authored Aug 29, 2023
1 parent 5dbb422 commit ca396e9
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"src/ecsScene/*",
"scripts/*.js",
"src/modules/project/export.ts",
"src/modules/analytics/rollbar.ts",
"src/modules/analytics/sentry.ts",
"src/modules/editor/base64.ts",
"package.json",
"package-lock.json",
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
src/contracts
src/ecsScene
src/components/Preview/loader.json
src/modules/analytics/rollbar.ts
165 changes: 165 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@dcl/sdk": "7.3.10",
"@dcl/single-sign-on-client": "^0.0.12",
"@dcl/ui-env": "^1.2.0",
"@sentry/react": "^7.64.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/user-event": "^13.5.0",
"@typechain/ethers-v5": "^10.1.0",
Expand Down
1 change: 1 addition & 0 deletions scripts/prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (fs.existsSync('.env')) {
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString())
const publicPackageJson = JSON.parse(fs.readFileSync('./public/package.json').toString())

ENV_CONTENT['REACT_APP_WEBSITE_NAME'] = packageJson.name
ENV_CONTENT['REACT_APP_WEBSITE_VERSION'] = packageJson.version

Object.assign(ENV_CONTENT, getPublicUrls())
Expand Down
3 changes: 2 additions & 1 deletion src/config/env/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"FORUM_URL": "https://forum.decentraland.org",
"WORLDS_CONTENT_SERVER": "https://worlds-content-server.decentraland.zone",
"PROFILE_URL": "https://profile.decentraland.zone",
"SSO_URL": "https://id.decentraland.zone"
"SSO_URL": "https://id.decentraland.zone",
"SENTRY_DSN": "https://428e8d298fb3f0fbcea645314a4a388c@o4504361728212992.ingest.sentry.io/4505748381564928"
}
3 changes: 2 additions & 1 deletion src/config/env/prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"FORUM_URL": "https://forum.decentraland.org",
"WORLDS_CONTENT_SERVER": "https://worlds-content-server.decentraland.org",
"PROFILE_URL": "https://profile.decentraland.org",
"SSO_URL": "https://id.decentraland.org"
"SSO_URL": "https://id.decentraland.org",
"SENTRY_DSN": "https://428e8d298fb3f0fbcea645314a4a388c@o4504361728212992.ingest.sentry.io/4505748381564928"
}
3 changes: 2 additions & 1 deletion src/config/env/stg.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"FORUM_URL": "https://forum.decentraland.org",
"WORLDS_CONTENT_SERVER": "https://worlds-content-server.decentraland.org",
"PROFILE_URL": "https://profile.decentraland.today",
"SSO_URL": "https://id.decentraland.today"
"SSO_URL": "https://id.decentraland.today",
"SENTRY_DSN": "https://428e8d298fb3f0fbcea645314a4a388c@o4504361728212992.ingest.sentry.io/4505748381564928"
}
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import * as languages from 'modules/translation/languages'
import Routes from 'routing'

import './modules/analytics/track'
import './modules/analytics/rollbar'
import './modules/analytics/sentry'
import './themes'
import './index.css'

Expand Down
22 changes: 0 additions & 22 deletions src/modules/analytics/rollbar.ts

This file was deleted.

17 changes: 17 additions & 0 deletions src/modules/analytics/sentry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { init, BrowserTracing, Replay } from '@sentry/react'
import { config } from '../../config'

init({
environment: config.get('ENVIRONMENT'),
release: `${process.env.REACT_APP_WEBSITE_NAME!}@${process.env.REACT_APP_WEBSITE_VERSION!}`,
dsn: config.get('SENTRY_DSN'),
integrations: [
new BrowserTracing(),
new Replay()
],
// Performance Monitoring
tracesSampleRate: 0.001, // Capture 1% 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.
})

0 comments on commit ca396e9

Please sign in to comment.