Skip to content

Commit

Permalink
feat: 添加sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
camera-2018 committed Feb 5, 2023
1 parent b3f7941 commit 5df26a1
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"dependencies": {
"@nuxt/image": "^0.7.1",
"@nuxt/image-edge": "^1.0.0-27840416.dc1ed65",
"@sentry/browser": "^7.36.0",
"@sentry/tracing": "^7.36.0",
"nuxt-umami": "^1.2.0"
},
"devDependencies": {
Expand Down
17 changes: 17 additions & 0 deletions frontend/plugins/sentry.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as Sentry from '@sentry/browser'
import { Integrations } from '@sentry/tracing'
import { defineNuxtPlugin } from '#app'
import * as pkg from '~/package.json'

export default defineNuxtPlugin(() => {
const release = `bytedream-juejin@${pkg.version}`
const environment = process.env.NODE_ENV
Sentry.init({
dsn: 'https://b86016d8b3a84a2eabeaffe5cfdb0a07@o4504625564483584.ingest.sentry.io/4504625567825920',
release,
environment,
integrations: [new Integrations.BrowserTracing()],
sampleRate: 1,
tracesSampleRate: 1,
})
})
52 changes: 52 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,17 @@
colors "~1.2.1"
string-argv "~0.3.1"

"@sentry/browser@^7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/browser/-/browser-7.36.0.tgz#097f00e1e48b5fb2705e94f32d915aec44104b57"
integrity sha512-Mu0OpisCZFICBGxVXdHWjUDgSvuQKjnO9acNcXR1+68IU08iX+cU6f2kq6VzI4mW/pNieI20FDFbx9KA0YZ4+A==
dependencies:
"@sentry/core" "7.36.0"
"@sentry/replay" "7.36.0"
"@sentry/types" "7.36.0"
"@sentry/utils" "7.36.0"
tslib "^1.9.3"

"@sentry/core@6.19.7":
version "6.19.7"
resolved "https://registry.npmmirror.com/@sentry/core/-/core-6.19.7.tgz"
Expand All @@ -2669,6 +2680,15 @@
"@sentry/utils" "6.19.7"
tslib "^1.9.3"

"@sentry/core@7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/core/-/core-7.36.0.tgz#37c82a1ad3f74dbe2c2fcd55f45068e127012fcc"
integrity sha512-lq1MlcMhvm7QIwUOknFeufkg4M6QREY3s61y6pm1o+o3vSqB7Hz0D19xlyEpP62qMn8OyuttVKOVK1UfGc2EyQ==
dependencies:
"@sentry/types" "7.36.0"
"@sentry/utils" "7.36.0"
tslib "^1.9.3"

"@sentry/hub@6.19.7":
version "6.19.7"
resolved "https://registry.npmmirror.com/@sentry/hub/-/hub-6.19.7.tgz"
Expand Down Expand Up @@ -2701,11 +2721,35 @@
lru_map "^0.3.3"
tslib "^1.9.3"

"@sentry/replay@7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/replay/-/replay-7.36.0.tgz#87b24d44e8136e8c3fccd1d80097097c0c67affa"
integrity sha512-wNbME74/2GtkqdDXz7NaStyfPWVLjYmN9TFWvu6E9sNl9pkDDvii/Qc8F6ps1wa7bozkKcWRHgNvYiGCxUBHcg==
dependencies:
"@sentry/core" "7.36.0"
"@sentry/types" "7.36.0"
"@sentry/utils" "7.36.0"

"@sentry/tracing@^7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/tracing/-/tracing-7.36.0.tgz#aa38319ed07f3b642134cf47da81f43df7835629"
integrity sha512-5R5mfWMDncOcTMmmyYMjgus1vZJzIFw4LHaSbrX7e1IRNT/6vFyNeVxATa2ePXb9mI3XHo5f2p7YrnreAtaSXw==
dependencies:
"@sentry/core" "7.36.0"
"@sentry/types" "7.36.0"
"@sentry/utils" "7.36.0"
tslib "^1.9.3"

"@sentry/types@6.19.7":
version "6.19.7"
resolved "https://registry.npmmirror.com/@sentry/types/-/types-6.19.7.tgz"
integrity sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==

"@sentry/types@7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/types/-/types-7.36.0.tgz#205baaf7332ff55d1fb35413cbde16dea4168520"
integrity sha512-uvfwUn3okAWSZ948D/xqBrkc3Sn6TeHUgi3+p/dTTNGAXXskzavgfgQ4rSW7f3YD4LL+boZojpoIARVLodMGuA==

"@sentry/utils@6.19.7":
version "6.19.7"
resolved "https://registry.npmmirror.com/@sentry/utils/-/utils-6.19.7.tgz"
Expand All @@ -2714,6 +2758,14 @@
"@sentry/types" "6.19.7"
tslib "^1.9.3"

"@sentry/utils@7.36.0":
version "7.36.0"
resolved "https://registry.npmmirror.com/@sentry/utils/-/utils-7.36.0.tgz#b81cf63c7b5daad3f0f152c4ad319203f968ba1b"
integrity sha512-mgDi5X5Bm0sydCzXpnyKD/sD98yc2qnKXyRdNX4HRRwruhC/P53LT0hGhZXsyqsB/l8OAMl0zWXJLg0xONQsEw==
dependencies:
"@sentry/types" "7.36.0"
tslib "^1.9.3"

"@simov/deep-extend@^1.0.0":
version "1.0.0"
resolved "https://registry.npmmirror.com/@simov/deep-extend/-/deep-extend-1.0.0.tgz"
Expand Down

0 comments on commit 5df26a1

Please sign in to comment.