Skip to content

Conversation

@solnic
Copy link
Collaborator

@solnic solnic commented Nov 14, 2025

This ensures that if silenced logging was used, the ActiveRecord log subscriber won't log silenced events.

@solnic solnic force-pushed the solnic/rails-add-support-for-silenced-logs branch from 8b2a19b to 55b9653 Compare November 14, 2025 15:02
@solnic solnic changed the title fix(rails): support silenced ActiveRecord events fix(rails): properly skip silenced logs from AR Nov 14, 2025
@solnic solnic force-pushed the solnic/rails-add-support-for-silenced-logs branch from 8733e4e to 01ac704 Compare November 14, 2025 15:08
@solnic solnic marked this pull request as ready for review November 14, 2025 15:13
@getsentry getsentry deleted a comment from codecov bot Nov 14, 2025
# @param event [ActiveSupport::Notifications::Event] The SQL event
def sql(event)
return unless Sentry.initialized?
return if logger && !logger.info?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this PR is targeting default which is ERROR, and it should solve the solid_queue silencing being ignored issue. Handling levels is actually a bigger task, because we just default to info right now.

@solnic solnic merged commit 6049bfd into master Nov 14, 2025
124 of 126 checks passed
@solnic solnic deleted the solnic/rails-add-support-for-silenced-logs branch November 14, 2025 20:11
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.17%. Comparing base (98f97b4) to head (01ac704).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../rails/log_subscribers/active_record_subscriber.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2775      +/-   ##
==========================================
- Coverage   90.18%   90.17%   -0.02%     
==========================================
  Files         132      132              
  Lines        5280     5281       +1     
==========================================
  Hits         4762     4762              
- Misses        518      519       +1     
Components Coverage Δ
sentry-ruby 97.25% <ø> (ø)
sentry-rails 55.66% <0.00%> (-0.07%) ⬇️
sentry-sidekiq 95.05% <ø> (ø)
sentry-resque 94.44% <ø> (ø)
sentry-delayed_job 94.68% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (ø)
Files with missing lines Coverage Δ
.../rails/log_subscribers/active_record_subscriber.rb 26.38% <0.00%> (-0.38%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants