Skip to content

Integrate Sentry.io for Error Tracking #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks
bhouston opened this issue Mar 7, 2025 · 1 comment · Fixed by #19
Closed
4 tasks

Integrate Sentry.io for Error Tracking #18

bhouston opened this issue Mar 7, 2025 · 1 comment · Fixed by #19

Comments

@bhouston
Copy link
Member

bhouston commented Mar 7, 2025

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-sentry package
  • Configure Sentry in docusaurus.config.ts with 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:

  1. Installation:
npm install docusaurus-plugin-sentry@latest
# or
yarn add docusaurus-plugin-sentry@latest
# or
pnpm add docusaurus-plugin-sentry@latest
  1. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant