feat(app): add sentry capture
This commit is contained in:
parent
8a1bbbc67b
commit
061015ccca
@ -30,6 +30,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
VITE_CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_KEY }}
|
VITE_CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_KEY }}
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
|
||||||
- name: Set docker chmod (temp solution)
|
- name: Set docker chmod (temp solution)
|
||||||
run: sudo chmod 666 /var/run/docker.sock
|
run: sudo chmod 666 /var/run/docker.sock
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
"@clerk/clerk-react": "^5.9.4",
|
"@clerk/clerk-react": "^5.9.4",
|
||||||
"@hookform/resolvers": "^3.9.0",
|
"@hookform/resolvers": "^3.9.0",
|
||||||
"@mdxeditor/editor": "^3.14.0",
|
"@mdxeditor/editor": "^3.14.0",
|
||||||
|
"@sentry/react": "^8.35.0",
|
||||||
|
"@sentry/vite-plugin": "^2.22.6",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@tanstack/react-query": "^5.59.0",
|
"@tanstack/react-query": "^5.59.0",
|
||||||
"@tanstack/react-router": "^1.58.15",
|
"@tanstack/react-router": "^1.58.15",
|
||||||
|
@ -4,6 +4,7 @@ import {
|
|||||||
TooltipProvider,
|
TooltipProvider,
|
||||||
} from '@boring.tools/ui'
|
} from '@boring.tools/ui'
|
||||||
import { ClerkProvider } from '@clerk/clerk-react'
|
import { ClerkProvider } from '@clerk/clerk-react'
|
||||||
|
import * as Sentry from '@sentry/react'
|
||||||
import { RouterProvider, createRouter } from '@tanstack/react-router'
|
import { RouterProvider, createRouter } from '@tanstack/react-router'
|
||||||
import { StrictMode } from 'react'
|
import { StrictMode } from 'react'
|
||||||
import ReactDOM from 'react-dom/client'
|
import ReactDOM from 'react-dom/client'
|
||||||
@ -12,6 +13,21 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|||||||
// Import the generated route tree
|
// Import the generated route tree
|
||||||
import { routeTree } from './routeTree.gen'
|
import { routeTree } from './routeTree.gen'
|
||||||
|
|
||||||
|
Sentry.init({
|
||||||
|
dsn: 'https://eee8b9e634a9ae0812518003d0512897@o4508167321354240.ingest.de.sentry.io/4508167916290128',
|
||||||
|
integrations: [
|
||||||
|
Sentry.browserTracingIntegration(),
|
||||||
|
Sentry.replayIntegration(),
|
||||||
|
],
|
||||||
|
// Tracing
|
||||||
|
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
||||||
|
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
||||||
|
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
|
||||||
|
// 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.
|
||||||
|
})
|
||||||
|
|
||||||
// Create a new router instance
|
// Create a new router instance
|
||||||
const router = createRouter({ routeTree })
|
const router = createRouter({ routeTree })
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { sentryVitePlugin } from '@sentry/vite-plugin'
|
||||||
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
|
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
@ -7,6 +8,18 @@ export default defineConfig({
|
|||||||
build: {
|
build: {
|
||||||
outDir: '../../build/app',
|
outDir: '../../build/app',
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [TanStackRouterVite(), react()],
|
plugins: [
|
||||||
|
TanStackRouterVite(),
|
||||||
|
react(),
|
||||||
|
sentryVitePlugin({
|
||||||
|
org: 'boringtools',
|
||||||
|
project: 'app',
|
||||||
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
||||||
|
sourcemaps: {
|
||||||
|
filesToDeleteAfterUpload: '**/*.map.*',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user