-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add ActiveRecord cached tag #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 👏
CI is breaking though – waiting for you to fix it
f80e50a
to
7c9ca70
Compare
Rubocop strikes again! |
7c9ca70
to
e4529a8
Compare
Test failure was some kind of race condition, I think. Writer wasn't dumping its spans before they were asserted upon. Weirdly enough, regardless of how I used I avoided this altogether by moving my caching ActiveRecord queries into a Sinatra endpoint, and then querying that endpoint to do the AR queries, instead of doing the AR queries directly in my test like I did previously. I honestly don't know why this fixed it, maybe something configuration related, but it seemed to eliminate the race condition for the test, and the need for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to me, but we need to fix the test suite first.
e4529a8
to
5935934
Compare
Seems to be failing specifically on the old versions of Ruby (1.9.3, 2.0.0, 2.1.10), ActiveRecord (3.2) and Sinatra (1.4.5.)
Digging deeper into this. |
5935934
to
7e1e922
Compare
Turns out my assertion didn't match output from different versions of ActiveRecord. Very minor, easy thing to fix, and an oversight on my part. |
Add the
cached
tag to ActiveRecord query spans that are cached.The old implementation was not correctly tagging ActiveRecord queries that were resolved through the query cache. This pull requests fixes that implementation, adds the same tag for ActiveRecord integrations outside of Rails, and adds test coverage for both scenarios.
Still need to ascertain what milestone this should be applied to.