Skip to content

Commit

Permalink
chore: add sentry error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Nov 11, 2024
1 parent 4938184 commit 6e9e3f3
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@headlessui/vue": "^1.7.14",
"@sentry/vue": "^8.37.1",
"@vueuse/core": "^10.1.2",
"dayjs": "^1.10.7",
"feather-icons": "^4.28.0",
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
pageMetaPlugin,
resourcesPlugin,
} from 'frappe-ui'
import * as Sentry from '@sentry/vue'
import router from './router'
import App from './App.vue'
import './index.css'
Expand Down Expand Up @@ -68,14 +69,24 @@ if (import.meta.env.DEV) {
socket = initSocket()
app.config.globalProperties.$socket = socket
app.mount('#app')
}
},
)
} else {
socket = initSocket()
app.config.globalProperties.$socket = socket
app.mount('#app')
}

// sentry error logging
if (import.meta.env.PROD && window.gameplan_frontend_sentry_dsn) {
Sentry.init({
app,
dsn: window.gameplan_frontend_sentry_dsn,
integrations: [Sentry.browserTracingIntegration({ router })],
tracesSampleRate: 1.0,
})
}

if (import.meta.env.DEV) {
window.$dayjs = dayjs
window.$user = getUser
Expand Down
81 changes: 81 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,87 @@
estree-walker "^2.0.2"
picomatch "^2.3.1"

"@sentry-internal/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.37.1.tgz#374028d8e37047aeda14b226707e6601de65996e"
integrity sha512-OSR/V5GCsSCG7iapWtXCT/y22uo3HlawdEgfM1NIKk1mkP15UyGQtGEzZDdih2H+SNuX1mp9jQLTjr5FFp1A5w==
dependencies:
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry-internal/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.37.1.tgz#e2d5fc934ca3b4925a5f5d0e63549830a1cf147e"
integrity sha512-Se25NXbSapgS2S+JssR5YZ48b3OY4UGmAuBOafgnMW91LXMxRNWRbehZuNUmjjHwuywABMxjgu+Yp5uJDATX+g==
dependencies:
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry-internal/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.37.1.tgz#e8a5e350e486b16938b3dd99886be23b7b6eff18"
integrity sha512-1JLAaPtn1VL5vblB0BMELFV0D+KUm/iMGsrl4/JpRm0Ws5ESzQl33DhXVv1IX/ZAbx9i14EjR7MG9+Hj70tieQ==
dependencies:
"@sentry-internal/replay" "8.37.1"
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry-internal/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.37.1.tgz#6dc2e3955879f6e7ab830db1ddee54e0a9b401f3"
integrity sha512-E/Plhisk/pXJjOdOU12sg8m/APTXTA21iEniidP6jW3/+O0tD/H/UovEqa4odNTqxPMa798xHQSQNt5loYiaLA==
dependencies:
"@sentry-internal/browser-utils" "8.37.1"
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.37.1.tgz#2e6e4accc395ad9e6313e07b09415370c71e5874"
integrity sha512-5ym+iGiIpjIKKpMWi9S3/tXh9xneS+jqxwRTJqed3cb8i4ydfMAAP8sM3U8xMCWWABpWyIUW+fpewC0tkhE1aQ==
dependencies:
"@sentry-internal/browser-utils" "8.37.1"
"@sentry-internal/feedback" "8.37.1"
"@sentry-internal/replay" "8.37.1"
"@sentry-internal/replay-canvas" "8.37.1"
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.37.1.tgz#4bafb25c762ec8680874056f6160df276c1cc7c6"
integrity sha512-82csXby589iDupM3VgCHJeWZagUyEEaDnbFcoZ/Z91QX2Sjq8FcF5OsforoXjw09i0XTFqlkFAnQVpDBmMXcpQ==
dependencies:
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@sentry/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.37.1.tgz#e92a7d346cfa29116568f4ffb58f65caedee0149"
integrity sha512-ryMOTROLSLINKFEbHWvi7GigNrsQhsaScw2NddybJGztJQ5UhxIGESnxGxWCufBmWFDwd7+5u0jDPCVUJybp7w==

"@sentry/[email protected]":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.37.1.tgz#6e020cd222d56d79953ea9d4630d91b3e323ceda"
integrity sha512-Qtn2IfpII12K17txG/ZtTci35XYjYi4CxbQ3j7nXY7toGv/+MqPXwV5q2i9g94XaSXlE5Wy9/hoCZoZpZs/djA==
dependencies:
"@sentry/types" "8.37.1"

"@sentry/vue@^8.37.1":
version "8.37.1"
resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-8.37.1.tgz#feeef0f0c6c428b4cbebd05eb8e5945dbb8c9f78"
integrity sha512-DHmQSrj+oqqxtJccYhXHpLuwNF1lTsLxfo8D8UYrnH+rDSdJ8RuyS8CCT7FzdY2y1hrXd3ixQUM/8fidtOHOWw==
dependencies:
"@sentry/browser" "8.37.1"
"@sentry/core" "8.37.1"
"@sentry/types" "8.37.1"
"@sentry/utils" "8.37.1"

"@socket.io/component-emitter@~3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
Expand Down
1 change: 1 addition & 0 deletions gameplan/www/g.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def get_boot():
'default_route': get_default_route(),
'site_name': frappe.local.site,
'read_only_mode': frappe.flags.read_only,
'gameplan_frontend_sentry_dsn': frappe.conf.gameplan_frontend_sentry_dsn
})

def on_login(login_manager):
Expand Down

0 comments on commit 6e9e3f3

Please sign in to comment.