Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag an ActiveRecord span as cached #1968

Merged
merged 4 commits into from
Dec 30, 2022

Conversation

kkumler
Copy link
Contributor

@kkumler kkumler commented Dec 19, 2022

When digging through a transaction, we could not readily confirm if a repeated ActiveRecord query was using the cache or not. The information is already sent along with the sql.active_record instrumentation since Rails 5.1 but only from the QueryCache origin.
The tag is added only if cached: true is in the payload.

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2022

Codecov Report

Base: 80.16% // Head: 98.01% // Increases project coverage by +17.84% 🎉

Coverage data is based on head (ef1baae) compared to base (81b0f9b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1968       +/-   ##
===========================================
+ Coverage   80.16%   98.01%   +17.84%     
===========================================
  Files         116      157       +41     
  Lines        5284     9862     +4578     
===========================================
+ Hits         4236     9666     +5430     
+ Misses       1048      196      -852     
Impacted Files Coverage Δ
...b/sentry/rails/tracing/active_record_subscriber.rb 100.00% <100.00%> (ø)
...try/rails/tracing/active_record_subscriber_spec.rb 100.00% <100.00%> (ø)
sentry-resque/lib/sentry/resque.rb 97.22% <0.00%> (-2.78%) ⬇️
sentry-rails/lib/sentry/rails/action_cable.rb 100.00% <0.00%> (ø)
...entry-rails/spec/sentry/rails/action_cable_spec.rb 100.00% <0.00%> (ø)
sentry-ruby/spec/sentry/transaction_spec.rb 100.00% <0.00%> (ø)
sentry-ruby/spec/sentry/scope_spec.rb 100.00% <0.00%> (ø)
sentry-ruby/spec/sentry/utils/real_ip_spec.rb 100.00% <0.00%> (ø)
sentry-ruby/spec/sentry/rake_spec.rb 100.00% <0.00%> (ø)
sentry-ruby/spec/sentry/span_spec.rb 100.00% <0.00%> (ø)
... and 79 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@st0012
Copy link
Collaborator

st0012 commented Dec 30, 2022

Thanks for this nice addition 👍

@st0012 st0012 merged commit 3145d84 into getsentry:master Dec 30, 2022
@kkumler kkumler deleted the active_record_cached branch January 5, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants