What are Breadcrumbs?
Breadcrumbs are automatically captured by Sentry for common actions like:- Console logs
- Network requests (fetch, XHR)
- UI clicks and interactions
- Navigation events
- DOM mutations
Adding Breadcrumbs
Basic Usage
With Additional Data
Breadcrumb Levels
Breadcrumbs support different severity levels:By default, Sentry keeps the last 100 breadcrumbs. This limit can be configured using the
maxBreadcrumbs option.Breadcrumb Categories
Organize breadcrumbs using categories:User Actions
Navigation
HTTP Requests
Console Logs
State Changes
Breadcrumb Types
Breadcrumbs can have specific types that affect how they’re displayed:Configuration
Maximum Breadcrumbs
Control how many breadcrumbs are kept:Filtering Breadcrumbs
Filter breadcrumbs before they’re added:Practical Examples
E-commerce Flow
API Integration
Form Validation
Working with Breadcrumbs in Scopes
Access Breadcrumbs
Get Last Breadcrumb
Clear Breadcrumbs
Automatic Breadcrumbs
Sentry automatically captures breadcrumbs for:Console Logs
HTTP Requests
Automatically captured by the default integrations.UI Events
Automatically captured for clicks and other interactions.Best Practices
- Be descriptive: Use clear, descriptive messages that explain what happened
- Use categories: Organize breadcrumbs with consistent category names
- Add relevant data: Include data that helps understand the context
- Avoid sensitive data: Don’t log passwords, tokens, or PII
- Keep them focused: Only add breadcrumbs for significant events
- Use appropriate levels: Match the breadcrumb level to the event severity
Breadcrumbs are automatically included with error events, providing a timeline of what led to the error.
Next Steps
Scopes
Learn about managing scope data
Context
Add structured context to events
Error Monitoring
Capture errors with breadcrumb trails
Performance
Track performance with breadcrumbs