-
-
Notifications
You must be signed in to change notification settings - Fork 525
Description
Issue Description
I believe that the MonotonicActiveSupportLogger is not submitting correct data to Sentry::Breadcrumb. We saw breadcrumb dates hovering around 1970 when we enabled this; switching to ActiveSupportLogger fixed the issue.
The reason for this is that I believe ActiveSupport::Notifications.monotonic_subscribe uses Process.clock_gettime(Process::CLOCK_MONOTONIC). The values from this call are floats that don't correspond to Unix epoch timestamps, which I believe is what Sentry::Breadcrumb expects.
ActiveSupport code in question: https://github.com/rails/rails/blob/v7.0.3.1/activesupport/lib/active_support/notifications/fanout.rb#L240-L255
MonotonicActiveSupportLogger calls .to_i on the timestamp:
sentry-ruby/sentry-rails/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb
Line 23 in 71da673
| timestamp: started.to_i |
Reproduction Steps
- Enable
monotonic_active_support_loggerinconfig.breadcrumbs_loggerfor Sentry initialization. - Submit some data
- Inspect breadcrumb timestamps in Sentry
Expected Behavior
The timestamps are correct.
Actual Behavior
The timestamps are shown as early in the year 1970.
Ruby Version
3.1.2
SDK Version
5.4.2
Integration and Its Version
No response
Sentry Config
No response