Skip to content

Missing or underreported errors for ActiveRecord::ConnectionTimeoutError #1563

@chris-canipe

Description

@chris-canipe

Describe the bug

We're seeing ActiveRecord::ConnectionTimeoutError errors in Airbrake and Splunk that are either:

  1. Not reported in Sentry; or
  2. Are reported in Sentry at a much lower rate

To Reproduce

Use up all pooled database connections and ask for more.

Expected behavior

The number of errors reported in Sentry are comparable to those reported in other tools.

Actual behavior

The errors are not reported in Sentry, or are reported at a much lower rate than in other tools; for example:

Sentry Splunk Airbrake
0 1.5k 1.3k
84 33.7k 27.2k
0 590 506
0 6k 5k
0 25.3k 21.4k
0 3k 2.4k

Environment

  • Ruby Version: 2.6.7
  • SDK Version: We've experienced this issue in 4.3.4, 4.5.1, and 4.6.5
  • Integration Versions:
    • Rails 5.2.6
    • Sidekiq 5.2.9

Sentry Config

Sentry.init do |config|
  config.debug = true

  config.environment = ENV.fetch('SENTRY_ENVIRONMENT') do
    case ENV['NAMESPACE'].to_s.underscore
    when 'portal_live'
      'production'
    when 'portal_staging'
      'staging'
    else
      'development'
    end
  end

  config.breadcrumbs_logger = %i[active_support_logger http_logger]

  # Custom, unrelated errors have been redacted
  config.excluded_exceptions += [
    'ActiveSupport::DeprecationException',
    'Redlock::LockNotRetrievedError',
    'Sidekiq::Limiter::OverLimit'
  ]

  config.inspect_exception_causes_for_exclusion = false

  # This was a recent addition: the issue happened prior to this
  config.rails.report_rescued_exceptions = false

  config.release = "portal@#{ENV['CURRENT_SHA']}"

  config.send_default_pii = false

  # This was a recent addition: the issue happened prior to this
  config.send_modules = false

  # This has changed throughout the history of the issue.
  # Effectively, this returns a minuscule value for most transactions.
  config.traces_sampler = ->(sampling_context) do
    # ...
  end

  # This has changed throughout the history of the issue.
  # We have logging and unit testing in place to ensure this is not the culprit.
  # Additionally, there are cases where we do see ActiveRecord::ConnectionTimeoutError
  # in Sentry, just at a much lower rate, further absolving any changes here.
  config.before_send = ->(event, hint) do
    # ...
  end
end

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions