Sentry
BetaSentry ↗ is an error tracking and performance monitoring platform that allows developers to diagnose, fix, and optimize the performance of their code.
This integration allows you to connect to a Sentry project from your Worker to automatically send errors and uncaught exceptions to Sentry with no code changes needed in the Workers application.
This integration adds a Tail Worker to your application Worker. The Tail Worker automatically sends errors and uncaught exceptions to the Sentry project you have configured.
This integration supports the following Sentry features:
- Data Handling ↗: As a best practice, do not include PII or other sensitive data in the payload sent to Sentry. HTTP headers (for example,
Authorization
orCookie
) can be removed before events are forwarded to Sentry. - Sampling ↗: Sampling can be configured to manage the number and type of events sent to Sentry. Sampling rates can be configured based on the HTTP status code returned by the Worker and for uncaught exceptions. Setting the sampling rate to 100% sends all events to Sentry or setting it to 30% sends approximately 30% of events to Sentry.
- Breadcrumbs ↗: Breadcrumbs create a trail of events that happened prior to an issue. Breadcrumbs are automatically forwarded to Sentry in the case of an error or exception. These events consist of the
console.log()
from the Worker before the error or exception occurred.
To set up an integration with Sentry, you need to have an existing Sentry project to connect to. Create a Sentry project ↗, or use an existing project for this integration. Then add the Sentry integration to your Worker.
To add the Sentry integration to your Worker:
- Log in to the Cloudflare dashboard ↗ and select your account.
- Select Workers & Pages.
- In Overview, select your Worker.
- Select Integrations > Sentry.
- Follow the setup flow.
Once installed, the integration will automatically start forwarding matching events to Sentry. To learn more about Sentry, refer to Sentry's official documentation ↗.