-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Integrate Sentry.io for Error Tracking
Description
We need to integrate Sentry.io with our Docusaurus site to track and monitor errors that occur in the production environment. This will help us identify and fix issues more quickly.
Implementation Tasks
- Install the
docusaurus-plugin-sentrypackage - Configure Sentry in
docusaurus.config.tswith a DSN from Sentry.io - Ensure error tracking only runs in production environments
- Test that errors are properly captured and reported to Sentry
Implementation Details
The integration can be done using the official docusaurus-plugin-sentry plugin:
- Installation:
npm install docusaurus-plugin-sentry@latest
# or
yarn add docusaurus-plugin-sentry@latest
# or
pnpm add docusaurus-plugin-sentry@latest- Configuration in
docusaurus.config.ts:
plugins: [
[
'docusaurus-plugin-sentry',
{
DSN: 'YOUR_SENTRY_DSN', // To be replaced with our actual Sentry DSN
allEnvironments: false, // Only enable in production by default
configuration: {
script: {
defer: true,
},
sentry: {
init: {
// Additional Sentry initialization options if needed
}
}
}
},
],
],Prerequisites
- A Sentry.io account
- A Sentry project created to obtain a DSN
Additional Considerations
- Consider configuring source maps uploading for better error context
- Set up proper release tracking to associate errors with specific deployments
Metadata
Metadata
Assignees
Labels
No labels