-
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
[active_record] decouple ActiveRecord and Sinatra integrations #330
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.
Let's wait for CI verdict because old Ruby versions can be full of surprises, but looks good, thanks !
@@ -57,22 +58,18 @@ def self.adapter_port | |||
@adapter_port ||= Datadog::Contrib::Rails::Utils.adapter_port | |||
end | |||
|
|||
def self.tracer |
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.
So normally as this is quite internal, nobody was using this. I let you decide wether it's worth mentioning in the release notes, but I'd say no.
end | ||
end | ||
|
||
it 'calls the instrumentation when is used standalone' do |
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.
this could be considered a regression test, since undoing the patch doesn't make it pass
def self.database_service | ||
return @database_service if defined?(@database_service) | ||
|
||
@database_service = get_option(:service_name) || adapter_name | ||
tracer.set_service_info(@database_service, 'sinatra', Ext::AppTypes::DB) | ||
get_option(:tracer).set_service_info(@database_service, 'sinatra', Ext::AppTypes::DB) |
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.
Why does this still say 'sinatra'
?
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.
@hawknewton correct! removing it!
4e94e37
to
2be20c3
Compare
expect(span.get_tag('sql.query')).to eq(nil) | ||
end | ||
|
||
it 'sends the right service information' do |
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.
@hawknewton added this integration test for the wrong service name you've discovered. Now it should be fine, thank you very much!
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.
@palazzem Awesome, thank you very much.
fc319c4
to
3816ea9
Compare
Overview
Closes #328.
When ActiveRecord is used standalone it should work without expecting other integrations to be activated. The following must be a legit instrumentation: