Skip to content

Remove monotonic_active_support_logger #1874

@mjhoy

Description

@mjhoy

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:

Reproduction Steps

  1. Enable monotonic_active_support_logger in config.breadcrumbs_logger for Sentry initialization.
  2. Submit some data
  3. 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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions