Sentry
Using it Yourself
There are two options for accessing Sentry:
- Join the existing project: Request access for errors on staging at https://backtocode.sentry.io/.
- Create your own account: Set up a new Sentry account, organization, etc., using a throwaway email. This option allows you to develop and debug locally.
Environment Variables
There are two key environment variables used for Sentry configuration on staging:
VITE_SENTRY_VUE_DSN: For the frontend configuration.SENTRY_LARAVEL_DSN: For the backend configuration.
to set them locally get the dsn from your account on sentry.io
Backend
The configuration for Sentry in the backend can be found in:
- \backend\config\sentry.php
In this file, you can customize Sentry's settings for error tracking in the backend.
Frontend
Most of the Sentry integration for the frontend is located in:
- frontend/apps/sentry/index.ts
For more advanced configurations or adjustments, refer to the official Sentry JavaScript documentation: Sentry Documentation
- tracesSampleRate: This determines the percentage of transactions you want to capture. By default, it is set to
0.1(10%). If you want to capture all the errors and traces, set it to1.0(100%).
Example:
typescript
Sentry.init({
tracesSampleRate: 1.0, // Adjust this to 1 for full tracing
integrations: [Sentry.browserTracingIntegration({router}), Sentry.replayIntegration()],
// Tracing
tracesSampleRate: 0.1, // Capture 10% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: [/^https:\/\/(staging|script\.staging)\.emmie\.nl(\/)?$/], // add localhost for local development
// Session Replay
replaysSessionSampleRate: 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.
ignoreErrors: ['AxiosError', /^Exact Match Message$/],
});