Skip to content

Commit

Permalink
added sentry as monitoring tool on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
andreciornavei committed Mar 8, 2024
1 parent f04f1e4 commit 89376dd
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MongoDB is being used for database.
- - The frontend is cached using CloudFront. Always a deploy happens, the cloudfront cache is invalidated by CI.
- ✅ Code structure and organization
- - Give an special attention to page structure, each page contains a conjunction of (context, controller, view, types, styles & index) files, where each one has its own responsability, improving readability;
- Performance and monitoring tools
- Performance and monitoring tools
- - Was made use of package _`use-context-selector`_ that improves the context providing. Also, for specific cases, was created an isolated component that inherit neededs data thought context, avoiding the re-render of entire screen.

## Stategic Decisions
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@mui/lab": "^5.0.0-alpha.167",
"@mui/material": "^5.15.12",
"@phosphor-icons/react": "^2.0.15",
"@sentry/react": "^7.106.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import './index.css'
import Router from './router'
import { enableMapSet } from 'immer'
import { DefaultTheme } from './theme'
import * as Sentry from '@sentry/react'
import ReactDOM from 'react-dom/client'
import { ApiProvider } from '@hooks/api'
import { AuthProvider } from '@hooks/auth'
Expand All @@ -11,6 +12,25 @@ import reportWebVitals from './reportWebVitals'
import { BrowserRouter } from 'react-router-dom'
enableMapSet()

// Install Sentry For Monitoring
Sentry.init({
dsn: 'https://56ff0892b732563d22086de012c5a22c@o4506876266741760.ingest.us.sentry.io/4506876269494272',
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
],
tracesSampleRate: 1.0,
tracePropagationTargets: [
'localhost',
/^https:\/\/bnb-bank.andreciornavei\.com\.br/,
],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
})

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
<ThemeProvider theme={DefaultTheme}>
Expand Down
84 changes: 83 additions & 1 deletion frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1965,6 +1965,88 @@
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.7.2.tgz#2d4260033e199b3032a08b41348ac10de21c47e9"
integrity sha512-RbhOOTCNoCrbfkRyoXODZp75MlpiHMgbE5MEBZAnnnLyQNgrigEj4p0lzsMDyc1zVsJDLrivB58tgg3emX0eEA==

"@sentry-internal/feedback@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.106.0.tgz#34a41f12093c09a9fec416600a11406afc60af96"
integrity sha512-Uz6pv3SN8XORTMme5xPxP/kuho7CAA6E/pMlpMjsojjBbnwLIICu10JaEZNsF/AtEya1RcNVTyPCrtF1F3sBYA==
dependencies:
"@sentry/core" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry-internal/replay-canvas@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.106.0.tgz#008c1cdc78a227ac2a84024dc79634f0c61f45bf"
integrity sha512-59qmT6XqbwpQuK1nVmv+XFxgd80gpYNH3aqgF5BEKux23kRB02/ARR5MwYyIHgVO0JhwdGIuiTfiLVNDu+nwTQ==
dependencies:
"@sentry/core" "7.106.0"
"@sentry/replay" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry-internal/tracing@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.106.0.tgz#0752f6925c5120848c05dc6c87a60b25896f834b"
integrity sha512-O8Es6Sa/tP80nfl+8soNfWzeRNFcT484SvjLR8BS3pHM9KDAlwNXyoQhFr2BKNYL1irbq6UF6eku4xCnUKVmqA==
dependencies:
"@sentry/core" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry/browser@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.106.0.tgz#195395a9ca5a7af774eae271cea2bc08964d8abf"
integrity sha512-OrHdw44giTtMa1DmlIUMBN4ypj1xTES9DLjq16ufK+bLqW3rWzwCuTy0sb9ZmSxc7fL2pdBlsL+sECiS+U2TEw==
dependencies:
"@sentry-internal/feedback" "7.106.0"
"@sentry-internal/replay-canvas" "7.106.0"
"@sentry-internal/tracing" "7.106.0"
"@sentry/core" "7.106.0"
"@sentry/replay" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry/core@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.106.0.tgz#501aebb349014189162dc77ec31eacbf45ee44c4"
integrity sha512-Dc13XtnyFaXup2E4vCbzuG0QKAVjrJBk4qfGwvSJaTuopEaEWBs2MpK6hRzFhsz9S3T0La7c1F/62NptvTUWsQ==
dependencies:
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry/react@^7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.106.0.tgz#84bdf925419a932376c6ab0427f7892a4db96bf1"
integrity sha512-5KMfvkBYqK990o8Ju9vsRRRR0F8TnPpZynC9YqsJYpCViKjIt8W/ysDLrU1Dj5XZyeVElZjdRlXB0aQYrwEUWg==
dependencies:
"@sentry/browser" "7.106.0"
"@sentry/core" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"
hoist-non-react-statics "^3.3.2"

"@sentry/replay@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.106.0.tgz#e66d78aa6a63b60a58bc78afbebf0e6ac308eea7"
integrity sha512-buaAOvOI+3pFm+76vwtxSxciBATHyR78aDjStghJZcIpFDNF31K8ZV0uP9+EUPbXHohtkTwZ86cn/P9cyY6NgA==
dependencies:
"@sentry-internal/tracing" "7.106.0"
"@sentry/core" "7.106.0"
"@sentry/types" "7.106.0"
"@sentry/utils" "7.106.0"

"@sentry/types@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.106.0.tgz#a68490c8d5f4b53f704af4c80535165e04c28e42"
integrity sha512-oKTkDaL6P9xJC5/zHLRemHTWboUqRYjkJNaZCN63j4kJqGy56wee4vDtDese/NWWn4U4C1QV1h+Mifm2HmDcQg==

"@sentry/utils@7.106.0":
version "7.106.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.106.0.tgz#a4c05f79672f734c1a1475428144ab97d2f7bea9"
integrity sha512-bVsePsXLpFu/1sH4rpJrPcnVxW2fXXfGfGxKs6Bm+dkOMbuVTlk/KAzIbdjCDIpVlrMDJmMNEv5xgTFjgWDkjw==
dependencies:
"@sentry/types" "7.106.0"

"@sinclair/typebox@^0.24.1":
version "0.24.51"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f"
Expand Down Expand Up @@ -5394,7 +5476,7 @@ he@^1.2.0:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

hoist-non-react-statics@^3.3.1:
hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
Expand Down

0 comments on commit 89376dd

Please sign in to comment.