Monitor your Astro Site with Sentry
هذا المحتوى غير متوفر بلغتك بعد.
Sentry offers a comprehensive application monitoring and error tracking service designed to help developers identify, diagnose, and resolve issues in real-time.
Read more on our blog about Astro’s partnership with Sentry and Sentry’s Spotlight dev toolbar app that brings a rich debug overlay into your Astro development environment. Spotlight shows errors, traces, and important context right in your browser during local development.
Sentry’s Astro SDK enables automatic reporting of errors and tracing data in your Astro application.
Project Configuration
Section titled Project ConfigurationA full list of prerequisites can be found in the Sentry guide for Astro.
Install
Section titled InstallSentry captures data by using an SDK within your application’s runtime.
Install the SDK by running the following command for the package manager of your choice in the Astro CLI:
The astro CLI installs the SDK package and adds the Sentry integration to your astro.config.mjs
file.
Configure
Section titled ConfigureTo configure the Sentry integration, you need to provide the following credentials in your astro.config.mjs
file.
- Client key (DSN) - You can find the DSN in your Sentry project settings under Client keys (DSN).
- Project name - You can find the project name in your Sentry project settings under General settings.
- Auth token - You can create an auth token in your Sentry organization settings under Auth tokens.
If you are creating a new Sentry project, select Astro as your platform to get all the necessary information to configure the SDK.
Once you’ve configured your sourceMapsUploadOptions
and added your dsn
, the SDK will automatically capture and send errors and performance events to Sentry.
Test your setup
Section titled Test your setupAdd the following <button>
element to one of your .astro
pages. This will allow you to manually trigger an error so you can test the error reporting process.
To view and resolve the recorded error, log into sentry.io and open your project.