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

Auto Enable All Instrumentation Feature #1260

Merged
merged 49 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
53c36d0
add spec for auto instrumentation script
ericmustin Nov 23, 2020
39c8f5d
fix log silencing and add readme docs
ericmustin Nov 23, 2020
644dba2
update rake spec
ericmustin Nov 23, 2020
1af7b0d
rubocop and acccount for jruby
ericmustin Nov 23, 2020
de481a0
update auto instrument logging approach and isolate tests
ericmustin Nov 30, 2020
7918d49
fix patchable specs
ericmustin Nov 30, 2020
6586217
rubocop linting
ericmustin Nov 30, 2020
36f6a91
add non rails auto instrument test
ericmustin Nov 30, 2020
f45cc9e
fix rakefile and explicitly check for true and use env var climate co…
ericmustin Nov 30, 2020
2dfdb14
fix specs for extensions
ericmustin Dec 1, 2020
a562e99
linting
ericmustin Dec 1, 2020
e28c90f
add auto_instrument? helper method to integrations
ericmustin Dec 9, 2020
49e8e35
rubocop
ericmustin Dec 9, 2020
6d6a627
fix specs for patachable
ericmustin Dec 9, 2020
9bdc7c7
fix active support patching
ericmustin Dec 9, 2020
a4ec733
fix action_cable patchable spec
ericmustin Dec 9, 2020
d07c6e5
update specs to be more appropriate for mocking raills env
ericmustin Dec 9, 2020
92f4c9d
get rid of warning logs around instance variable defined in module
ericmustin Dec 9, 2020
8347797
improve language in readme
ericmustin Dec 9, 2020
551735d
Update Ruby Auto Instrument all Integrations doc section
marcotc Dec 9, 2020
abd8752
update helpers and combine utils files for rails
ericmustin Dec 10, 2020
2fe0339
Merge branch 'autoload_instrumentation' of github.com:DataDog/dd-trac…
ericmustin Dec 10, 2020
2585ee0
add wrapper for auto instrument specs
ericmustin Dec 10, 2020
f02d9b9
kick ci
ericmustin Dec 10, 2020
7c83169
comment out helpers to see if active model serializers work
ericmustin Dec 10, 2020
39d7967
leave shared spec skeleton
ericmustin Dec 10, 2020
b70210f
add back spec helper
ericmustin Dec 10, 2020
7ff49cc
kick ci again
ericmustin Dec 10, 2020
28c0da0
add comment explaining auto_instrument?
ericmustin Dec 11, 2020
168cb97
stubbbing auto instrument spec
ericmustin Dec 11, 2020
3626e2d
pump mysql2 version
ericmustin Dec 11, 2020
b917f88
add back specs
ericmustin Dec 11, 2020
caff3cd
add logging for debugging
ericmustin Dec 11, 2020
5c35252
add more logging for debugging
ericmustin Dec 11, 2020
7c412f4
add correct logging for debugging
ericmustin Dec 11, 2020
dfab8a5
remove logs
ericmustin Dec 11, 2020
7bbc890
hardcode tests until we can determine 6.1 issue for sinatra
ericmustin Dec 11, 2020
dcd5b49
hardcode sinatra tests due to mocks breaking in 6.1
ericmustin Dec 11, 2020
1f036eb
fix specs for 6.1 workaround
ericmustin Dec 11, 2020
0c55dda
more spec fixes
ericmustin Dec 11, 2020
79f8f9b
refactor auto instrument
ericmustin Jan 6, 2021
c38116f
merge master
ericmustin Jan 6, 2021
916d5ca
linting
ericmustin Jan 6, 2021
a7b7420
add base methods
ericmustin Jan 7, 2021
33defed
cleanup
ericmustin Jan 7, 2021
b08df89
remove overcomplicated auto instrument extend approach
ericmustin Jan 7, 2021
013f1dd
remove railtie
ericmustin Jan 7, 2021
52be987
add back railtie to handle loading order issues
ericmustin Jan 7, 2021
35c8e6b
auto instrumentation readme updates
ericmustin Jan 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ namespace :spec do

RSpec::Core::RakeTask.new(:main) do |t, args|
t.pattern = 'spec/**/*_spec.rb'
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,opentracer,opentelemetry}/**/*_spec.rb'
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,opentracer,opentelemetry,auto_instrument}/**/*_spec.rb,'\
' spec/**/auto_instrument_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

Expand All @@ -38,7 +39,7 @@ namespace :spec do

RSpec::Core::RakeTask.new(:rails) do |t, args|
t.pattern = 'spec/ddtrace/contrib/rails/**/*_spec.rb'
t.exclude_pattern = 'spec/ddtrace/contrib/rails/**/*{active_job,disable_env,redis_cache}*_spec.rb'
t.exclude_pattern = 'spec/ddtrace/contrib/rails/**/*{active_job,disable_env,redis_cache,auto_instrument}*_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

Expand All @@ -57,6 +58,16 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:railsautoinstrument) do |t, args|
t.pattern = 'spec/ddtrace/contrib/rails/**/*auto_instrument*_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:autoinstrument) do |t, args|
t.pattern = 'spec/ddtrace/auto_instrument_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:contrib) do |t, args|
contrib_paths = [
'analytics',
Expand Down Expand Up @@ -220,6 +231,7 @@ task :ci do
declare 'bundle exec appraisal contrib-old rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib-old rake spec:active_record'
declare 'bundle exec appraisal contrib-old rake spec:active_support'
declare 'bundle exec appraisal contrib-old rake spec:autoinstrument'
declare 'bundle exec appraisal contrib-old rake spec:aws'
declare 'bundle exec appraisal contrib-old rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib-old rake spec:dalli'
Expand All @@ -246,10 +258,12 @@ task :ci do
# Rails minitests
declare 'bundle exec appraisal rails30-postgres rake test:rails'
declare 'bundle exec appraisal rails30-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails30-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails32-mysql2 rake test:rails'
declare 'bundle exec appraisal rails32-postgres rake test:rails'
declare 'bundle exec appraisal rails32-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails32-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails32-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails30-postgres rake spec:rails'
declare 'bundle exec appraisal rails32-mysql2 rake spec:rails'
Expand All @@ -275,6 +289,7 @@ task :ci do
declare 'bundle exec appraisal contrib-old rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib-old rake spec:active_record'
declare 'bundle exec appraisal contrib-old rake spec:active_support'
declare 'bundle exec appraisal contrib-old rake spec:autoinstrument'
declare 'bundle exec appraisal contrib-old rake spec:aws'
declare 'bundle exec appraisal contrib-old rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib-old rake spec:dalli'
Expand Down Expand Up @@ -303,14 +318,17 @@ task :ci do
# Rails minitests
declare 'bundle exec appraisal rails30-postgres rake test:rails'
declare 'bundle exec appraisal rails30-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails30-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails32-mysql2 rake test:rails'
declare 'bundle exec appraisal rails32-postgres rake test:rails'
declare 'bundle exec appraisal rails32-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails32-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails32-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails4-mysql2 rake test:rails'
declare 'bundle exec appraisal rails4-postgres rake test:rails'
declare 'bundle exec appraisal rails4-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails4-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails4-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails30-postgres rake spec:rails'
declare 'bundle exec appraisal rails32-mysql2 rake spec:rails'
Expand Down Expand Up @@ -339,6 +357,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:dalli'
Expand Down Expand Up @@ -375,21 +394,25 @@ task :ci do
# Rails minitests
declare 'bundle exec appraisal rails30-postgres rake test:rails'
declare 'bundle exec appraisal rails30-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails30-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails32-mysql2 rake test:rails'
declare 'bundle exec appraisal rails32-postgres rake test:rails'
declare 'bundle exec appraisal rails32-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails32-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails32-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails4-mysql2 rake test:rails'
declare 'bundle exec appraisal rails4-postgres rake test:rails'
declare 'bundle exec appraisal rails4-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails4-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails4-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails4-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-mysql2 rake test:rails'
declare 'bundle exec appraisal rails5-postgres rake test:rails'
declare 'bundle exec appraisal rails5-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails30-postgres rake spec:rails'
declare 'bundle exec appraisal rails32-mysql2 rake spec:rails'
Expand All @@ -415,6 +438,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:dalli'
Expand Down Expand Up @@ -452,21 +476,25 @@ task :ci do
# Rails minitests
declare 'bundle exec appraisal rails30-postgres rake test:rails'
declare 'bundle exec appraisal rails30-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails30-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails32-mysql2 rake test:rails'
declare 'bundle exec appraisal rails32-postgres rake test:rails'
declare 'bundle exec appraisal rails32-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails32-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails32-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails4-mysql2 rake test:rails'
declare 'bundle exec appraisal rails4-postgres rake test:rails'
declare 'bundle exec appraisal rails4-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails4-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails4-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails4-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-mysql2 rake test:rails'
declare 'bundle exec appraisal rails5-postgres rake test:rails'
declare 'bundle exec appraisal rails5-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails30-postgres rake spec:rails'
declare 'bundle exec appraisal rails32-mysql2 rake spec:rails'
Expand Down Expand Up @@ -497,6 +525,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:dalli'
Expand Down Expand Up @@ -539,6 +568,7 @@ task :ci do
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails5-mysql2 rake spec:rails'
declare 'bundle exec appraisal rails5-postgres rake spec:rails'
Expand Down Expand Up @@ -566,6 +596,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:cucumber'
Expand Down Expand Up @@ -610,12 +641,14 @@ task :ci do
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails6-mysql2 rake test:rails'
declare 'bundle exec appraisal rails6-postgres rake test:rails'
declare 'bundle exec appraisal rails6-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails6-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails6-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails5-mysql2 rake spec:action_cable'
declare 'bundle exec appraisal rails5-mysql2 rake spec:rails'
Expand Down Expand Up @@ -657,6 +690,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:cucumber'
Expand Down Expand Up @@ -702,12 +736,14 @@ task :ci do
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails6-mysql2 rake test:rails'
declare 'bundle exec appraisal rails6-postgres rake test:rails'
declare 'bundle exec appraisal rails6-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails6-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails6-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails5-mysql2 rake spec:action_cable'
declare 'bundle exec appraisal rails5-mysql2 rake spec:rails'
Expand Down Expand Up @@ -750,6 +786,7 @@ task :ci do
declare 'bundle exec appraisal contrib rake spec:active_model_serializers'
declare 'bundle exec appraisal contrib rake spec:active_record'
declare 'bundle exec appraisal contrib rake spec:active_support'
declare 'bundle exec appraisal contrib rake spec:autoinstrument'
declare 'bundle exec appraisal contrib rake spec:aws'
declare 'bundle exec appraisal contrib rake spec:concurrent_ruby'
declare 'bundle exec appraisal contrib rake spec:cucumber'
Expand Down Expand Up @@ -795,12 +832,14 @@ task :ci do
declare 'bundle exec appraisal rails5-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails5-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails5-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails5-postgres rake spec:railsautoinstrument'
declare 'bundle exec appraisal rails6-mysql2 rake test:rails'
declare 'bundle exec appraisal rails6-postgres rake test:rails'
declare 'bundle exec appraisal rails6-postgres-redis rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-redis-activesupport rake spec:railsredis'
declare 'bundle exec appraisal rails6-postgres-sidekiq rake spec:railsactivejob'
declare 'bundle exec appraisal rails6-postgres rake spec:railsdisableenv'
declare 'bundle exec appraisal rails6-postgres rake spec:railsautoinstrument'
# Rails specs
declare 'bundle exec appraisal rails5-mysql2 rake spec:rails'
declare 'bundle exec appraisal rails5-postgres rake spec:rails'
Expand Down
33 changes: 33 additions & 0 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ Install and configure the Datadog Agent to receive traces from your now instrume

### Quickstart for Rails applications

#### Rails Auto Instrument all Integrations

1. Add the `ddtrace` gem to your Gemfile:

```ruby
source 'https://rubygems.org'
gem 'ddtrace', require: 'ddtrace/auto_instrument'
Comment on lines +152 to +153
Copy link
Member

Choose a reason for hiding this comment

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

This looks awesome! So much simpler than today 🎉.

```

2. Install the gem with `bundle install`

3. You can configure, override, or disable any specific integration settings by also adding a [Rails Manual Configuration](#rails-manual-configuration) file.

#### Rails Manual Configuration

1. Add the `ddtrace` gem to your Gemfile:

```ruby
Expand All @@ -165,6 +180,24 @@ Install and configure the Datadog Agent to receive traces from your now instrume

### Quickstart for Ruby applications

#### Ruby Auto Instrument all Integrations

Choose a reason for hiding this comment

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

Should we not say here "Auto Instrument All Integrations". That's a bit wordy and inconsistent with how we describe in other languages. Maybe just "Automatic Instrumentation" and "Manual Instrumentation"

Copy link
Member

Choose a reason for hiding this comment

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

It reads much better with your suggestion, probably an oversight on our side here. I'll make these changes. 🙇 @andrewsouthard1


1. Install the gem with `gem install ddtrace`
2. Add `require 'ddtrace/auto_instrument'` to your application startup sequence. This must be done _after_ requiring any [supported libraries or frameworks](#integration-instrumentation) that should be instrumented.

```ruby
# Example frameworks and libraries
require 'sinatra'
marcotc marked this conversation as resolved.
Show resolved Hide resolved
require 'faraday'
require 'redis'

require 'ddtrace/auto_instrument'
```

You can configure, override, or disable any specific integration settings by also adding a [Ruby Manual Configuration Block](#ruby-manual-configuration).

#### Ruby Manual Configuration

1. Install the gem with `gem install ddtrace`
2. Add a configuration block to your Ruby application:

Expand Down
4 changes: 4 additions & 0 deletions lib/ddtrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ module Datadog
require 'ddtrace/opentelemetry/extensions'
extend OpenTelemetry::Extensions

# Load and extend AutoInstrument
require 'ddtrace/contrib/auto_instrument'
extend Contrib::AutoInstrument

# Add shutdown hook:
# Ensures the tracer has an opportunity to flush traces
# and cleanup before terminating the process.
Expand Down
3 changes: 3 additions & 0 deletions lib/ddtrace/auto_instrument.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'ddtrace'

Datadog.add_auto_instrument if Datadog.respond_to?(:add_auto_instrument)
Copy link
Member

Choose a reason for hiding this comment

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

Datadog.add_auto_instrument is always defined now, as of latest changes, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, can remove the defensive check here now

7 changes: 7 additions & 0 deletions lib/ddtrace/contrib/action_cable/integration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/action_cable/configuration/settings'
require 'ddtrace/contrib/action_cable/patcher'
require 'ddtrace/contrib/rails/utils'

module Datadog
module Contrib
Expand All @@ -25,6 +26,12 @@ def self.compatible?
super && version >= MINIMUM_VERSION
end

# enabled by rails integration so should only auto instrument
# if detected that it is being used without rails
def auto_instrument?
!Datadog::Contrib::Rails::Utils.railtie_supported?
end

def default_configuration
Configuration::Settings.new
end
Expand Down
7 changes: 7 additions & 0 deletions lib/ddtrace/contrib/action_pack/integration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/action_pack/configuration/settings'
require 'ddtrace/contrib/action_pack/patcher'
require 'ddtrace/contrib/rails/utils'

module Datadog
module Contrib
Expand All @@ -25,6 +26,12 @@ def self.compatible?
super && version >= MINIMUM_VERSION
end

# enabled by rails integration so should only auto instrument
# if detected that it is being used without rails
def auto_instrument?
!Datadog::Contrib::Rails::Utils.railtie_supported?
end

def default_configuration
Configuration::Settings.new
end
Expand Down
7 changes: 7 additions & 0 deletions lib/ddtrace/contrib/action_view/integration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/action_view/configuration/settings'
require 'ddtrace/contrib/action_view/patcher'
require 'ddtrace/contrib/rails/utils'

module Datadog
module Contrib
Expand Down Expand Up @@ -32,6 +33,12 @@ def self.compatible?
super && version >= MINIMUM_VERSION
end

# enabled by rails integration so should only auto instrument
# if detected that it is being used without rails
def auto_instrument?
!Datadog::Contrib::Rails::Utils.railtie_supported?
end

def default_configuration
Configuration::Settings.new
end
Expand Down
7 changes: 7 additions & 0 deletions lib/ddtrace/contrib/active_record/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'ddtrace/contrib/active_record/configuration/resolver'
require 'ddtrace/contrib/active_record/configuration/settings'
require 'ddtrace/contrib/active_record/patcher'
require 'ddtrace/contrib/rails/utils'

module Datadog
module Contrib
Expand All @@ -29,6 +30,12 @@ def self.compatible?
super && version >= MINIMUM_VERSION
end

# enabled by rails integration so should only auto instrument
# if detected that it is being used without rails
def auto_instrument?
!Datadog::Contrib::Rails::Utils.railtie_supported?
end

def default_configuration
Configuration::Settings.new
end
Expand Down
Loading