Issue
We want to know how long it takes for simple log messages with the "addBreadcrumb" method to actually reach your platform in order to view and filter them. After testing locally we were able to see the messages on the platform after a few hours. I thought that the message was supposed to arrive instantly.
Applies To
- All SaaS Customers and Self-Hosted Users
- Error Monitoring
Resolution
Breadcrumbs and error events in Sentry work differently:
- Breadcrumbs (like your
addBreadcrumb
calls) are not sent to Sentry immediately. They are collected and stored locally during runtime, then only sent when an actual error event occurs. As mentioned in the documentation:
Breadcrumbs are different from events: they will not create an event in Sentry, but will be buffered until the next event is sent.
-
Error events (like your
captureException
calls) are sent to Sentry when they occur, and they include any breadcrumbs that were collected before the error.
This can explain why you may not see your breadcrumbs until hours later - they are only sent when an actual exception was captured and sent to Sentry.
If you want to ensure your events are being sent properly, you can check the debug logs. This should show you when events are actually being sent to Sentry.
For more reliable monitoring of time-sensitive events, you might want to consider using Sentry's Performance Monitoring features. This would give you more detailed timing information about your application's performance.
Alternatively, it would be more efficient for you to use Sentry.captureMessage(), which will send an event to Sentry immediately. If your goal is to essentially do logging, please refer to this guide.
In summary, breadcrumbs alone don't trigger sending data to Sentry - they're only sent along with actual error or span events, which can explain the delay you might experience.