ddtrace 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a9186d275327ce22e549c851bfa05a3d35f2331
4
- data.tar.gz: 80ddf28da3679f110f6c2b570ca2d7356ada9ce2
3
+ metadata.gz: 82af04eeea1caa84867aaa757ad13417edc2023e
4
+ data.tar.gz: 2f08f3addafedcdb596eaa5745085373172b3c53
5
5
  SHA512:
6
- metadata.gz: e754f087c383bb50d2c4738fceee184b8766d5c880a2980005b0fee2ae36f301c843a0b88d873bc5e571f951e14c49a9de9b3598f708467b34b99e923b023202
7
- data.tar.gz: 679c519b49988a592bb4c9ac434384fc2bea7d5ba7dc710596e097fa814a1064d6de1565748c966f7d715f3f3d319070ba0c5b330510555c6111a70024df5e86
6
+ metadata.gz: f8a4f8c8a1c8e105adf40b1d47cc7504ca8b247eb7763f560ed6a86718e5213a1cd44c07f82ff2a73625d586490e5e81df49d6d1f143cc27681ad7b541fa8028
7
+ data.tar.gz: e9bb6304e1e375050d9203601881b50b9422aa53c64ba8938c5b75d052946e12ae1384be6dd5364c94df01839fffc4e2986f37d5880d52ca720b742add8dd0ad
data/Appraisals CHANGED
@@ -1,65 +1,69 @@
1
- appraise "rails3-postgres" do
2
- gem "test-unit"
3
- gem "rails", "3.2.22.5"
4
- gem "pg", platform: :ruby
5
- gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
6
- end
7
-
8
- appraise "rails4-postgres" do
9
- gem "rails", "4.2.7.1"
10
- gem "pg", platform: :ruby
11
- gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
12
- end
13
-
14
- appraise "rails3-mysql2" do
15
- gem "test-unit"
16
- gem "rails", "3.2.22.5"
17
- gem "mysql2", "0.3.21", platform: :ruby
18
- gem "activerecord-mysql-adapter", platform: :ruby
19
- gem 'activerecord-jdbcmysql-adapter', platform: :jruby
20
- end
21
-
22
- appraise "rails4-mysql2" do
23
- gem "rails", "4.2.7.1"
24
- gem "mysql2", platform: :ruby
25
- gem 'activerecord-jdbcmysql-adapter', platform: :jruby
26
- end
27
-
28
- appraise "rails3-postgres-redis" do
29
- gem "test-unit"
30
- gem "rails", "3.2.22.5"
31
- gem "pg", platform: :ruby
32
- gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
33
- gem "redis-rails"
34
- end
35
-
36
- appraise "rails4-postgres-redis" do
37
- gem "rails", "4.2.7.1"
38
- gem "pg", platform: :ruby
39
- gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
40
- gem "redis-rails"
41
- end
1
+ if RUBY_VERSION < "2.4.0"
2
+ appraise "rails3-postgres" do
3
+ gem "test-unit"
4
+ gem "rails", "3.2.22.5"
5
+ gem "pg", platform: :ruby
6
+ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
7
+ end
42
8
 
43
- if RUBY_VERSION >= "2.2.2" && RUBY_PLATFORM != "java"
44
- appraise "rails5-postgres" do
45
- gem "rails", "5.0.0.1"
9
+ appraise "rails4-postgres" do
10
+ gem "rails", "4.2.7.1"
46
11
  gem "pg", platform: :ruby
12
+ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
13
+ end
14
+
15
+ appraise "rails3-mysql2" do
16
+ gem "test-unit"
17
+ gem "rails", "3.2.22.5"
18
+ gem "mysql2", "0.3.21", platform: :ruby
19
+ gem "activerecord-mysql-adapter", platform: :ruby
20
+ gem 'activerecord-jdbcmysql-adapter', platform: :jruby
47
21
  end
48
22
 
49
- appraise "rails5-mysql2" do
50
- gem "rails", "5.0.0.1"
23
+ appraise "rails4-mysql2" do
24
+ gem "rails", "4.2.7.1"
51
25
  gem "mysql2", platform: :ruby
26
+ gem 'activerecord-jdbcmysql-adapter', platform: :jruby
52
27
  end
53
28
 
54
- appraise "rails5-postgres-redis" do
55
- gem "rails", "5.0.0.1"
29
+ appraise "rails3-postgres-redis" do
30
+ gem "test-unit"
31
+ gem "rails", "3.2.22.5"
56
32
  gem "pg", platform: :ruby
33
+ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
57
34
  gem "redis-rails"
58
35
  end
36
+
37
+ appraise "rails4-postgres-redis" do
38
+ gem "rails", "4.2.7.1"
39
+ gem "pg", platform: :ruby
40
+ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
41
+ gem "redis-rails"
42
+ end
43
+
44
+ if RUBY_VERSION >= "2.2.2" && RUBY_PLATFORM != "java"
45
+ appraise "rails5-postgres" do
46
+ gem "rails", "5.0.1"
47
+ gem "pg", platform: :ruby
48
+ end
49
+
50
+ appraise "rails5-mysql2" do
51
+ gem "rails", "5.0.1"
52
+ gem "mysql2", platform: :ruby
53
+ end
54
+
55
+ appraise "rails5-postgres-redis" do
56
+ gem "rails", "5.0.1"
57
+ gem "pg", platform: :ruby
58
+ gem "redis-rails"
59
+ end
60
+ end
59
61
  end
60
62
 
61
63
  appraise "contrib" do
62
64
  gem "elasticsearch-transport"
63
65
  gem "redis"
64
66
  gem "hiredis"
67
+ gem "rack-test"
68
+ gem "sinatra"
65
69
  end
data/README.md CHANGED
@@ -58,7 +58,7 @@ to trace requests to the home page:
58
58
  ### Monkey patching
59
59
 
60
60
  By default, our monkey-patching is not active, you need to
61
- explicitly activate it by calling `Datadog::Monkey.patch_all`
61
+ explicitly activate it by calling `Datadog::Monkey.patch_all`
62
62
  or `Datadog::Monkey.patch_module`
63
63
 
64
64
  This ultimately allows you to enable or disable tracing on a per-library basis.
@@ -87,12 +87,12 @@ Configure your environment through:
87
87
  $ bundle install
88
88
  $ appraisal install
89
89
 
90
- You can launch all tests using the following rake command:
90
+ You can launch tests using the following rake command:
91
91
 
92
- $ rake test # tracer tests
93
- $ appraisal rails<version>-<database>rake rails # tests Rails matrix
94
- $ appraisal contrib rake contrib # tests other contrib libraries (Redis, ...)
95
- $ appraisal contrib rake monkey # tests monkey patching
92
+ $ rake test:main # tracer tests
93
+ $ appraisal rails<version>-<database>rake test:rails # tests Rails matrix
94
+ $ appraisal contrib rake test:redis # tests Redis integration
95
+ $ appraisal contrib rake test:monkey # tests monkey patching
96
96
 
97
97
  Available appraisals are:
98
98
 
data/Rakefile CHANGED
@@ -4,39 +4,42 @@ require 'rake/testtask'
4
4
  require 'rdoc/task'
5
5
  require 'appraisal'
6
6
 
7
- Rake::TestTask.new(:test) do |t|
8
- t.libs << %w(test lib)
9
- t.test_files = FileList['test/**/*_test.rb'].reject do |path|
10
- path.include?('contrib') ||
11
- path.include?('benchmark') ||
12
- path.include?('redis') ||
13
- path.include?('monkey_test.rb')
7
+ namespace :test do
8
+ task all: [:main, :rails, :railsredis, :elasticsearch, :http, :redis, :sinatra, :monkey]
9
+
10
+ Rake::TestTask.new(:main) do |t|
11
+ t.libs << %w(test lib)
12
+ t.test_files = FileList['test/**/*_test.rb'].reject do |path|
13
+ path.include?('contrib') ||
14
+ path.include?('benchmark') ||
15
+ path.include?('redis') ||
16
+ path.include?('monkey_test.rb')
17
+ end
14
18
  end
15
- end
16
19
 
17
- Rake::TestTask.new(:rails) do |t|
18
- t.libs << %w(test lib)
19
- t.test_files = FileList['test/contrib/rails/**/*_test.rb'].reject do |path|
20
- path.include?('redis')
20
+ Rake::TestTask.new(:rails) do |t|
21
+ t.libs << %w(test lib)
22
+ t.test_files = FileList['test/contrib/rails/**/*_test.rb'].reject do |path|
23
+ path.include?('redis')
24
+ end
21
25
  end
22
- end
23
26
 
24
- Rake::TestTask.new(:railsredis) do |t|
25
- t.libs << %w(test lib)
26
- t.test_files = FileList['test/contrib/rails/**/*redis*_test.rb']
27
- end
27
+ Rake::TestTask.new(:railsredis) do |t|
28
+ t.libs << %w(test lib)
29
+ t.test_files = FileList['test/contrib/rails/**/*redis*_test.rb']
30
+ end
28
31
 
29
- Rake::TestTask.new(:contrib) do |t|
30
- t.libs << %w(test lib)
31
- t.test_files = FileList['test/contrib/**/*_test.rb'].reject do |path|
32
- path.include?('rails') ||
33
- path.include?('monkey_test.rb')
32
+ [:elasticsearch, :http, :redis, :sinatra].each do |contrib|
33
+ Rake::TestTask.new(contrib) do |t|
34
+ t.libs << %w(test lib)
35
+ t.test_files = FileList["test/contrib/#{contrib}/*_test.rb"]
36
+ end
34
37
  end
35
- end
36
38
 
37
- Rake::TestTask.new(:monkey) do |t|
38
- t.libs << %w(test lib)
39
- t.test_files = FileList['test/monkey_test.rb']
39
+ Rake::TestTask.new(:monkey) do |t|
40
+ t.libs << %w(test lib)
41
+ t.test_files = FileList['test/monkey_test.rb']
42
+ end
40
43
  end
41
44
 
42
45
  Rake::TestTask.new(:benchmark) do |t|
data/circle.yml CHANGED
@@ -2,10 +2,11 @@ machine:
2
2
  services:
3
3
  - docker
4
4
  environment:
5
- MRI_VERSIONS: 2.3.1,2.2.5,2.1.10
6
- RAILS5_VERSIONS: 2.3.1,2.2.5
7
- JRUBY_VERSIONS: jruby-9.1.5.0
8
- JRUBY_OPTS: --dev
5
+ LAST_STABLE: 2.4.0
6
+ EARLY_STABLE: 2.1.10
7
+ MRI_VERSIONS: 2.4.0,2.3.3,2.2.6,2.1.10
8
+ RAILS_VERSIONS: 2.3.3,2.2.6,2.1.10
9
+ RAILS5_VERSIONS: 2.3.3,2.2.6
9
10
  AGENT_BUILD_PATH: "/home/ubuntu/agent"
10
11
  TEST_DATADOG_INTEGRATION: 1
11
12
 
@@ -23,34 +24,38 @@ dependencies:
23
24
  - bundle install
24
25
  - rvm get head
25
26
  - rvm install $MRI_VERSIONS
26
- - rvm install $JRUBY_VERSIONS
27
27
  # prepare and run the trace agent
28
28
  # TODO[manu]: remove this part when everything will be open source
29
29
  - git clone git@github.com:DataDog/datadog-trace-agent.git $AGENT_BUILD_PATH
30
30
  - cd $AGENT_BUILD_PATH && docker build -t datadog/trace-agent .
31
31
  - docker run -d -e DD_API_KEY=invalid_key_but_this_is_fine -e DD_BIND_HOST=0.0.0.0 -p 127.0.0.1:7777:7777 datadog/trace-agent
32
32
  override:
33
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do gem install bundler
34
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do bundle install
35
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal install
33
+ - rvm $MRI_VERSIONS --verbose do gem update --system
34
+ - rvm $MRI_VERSIONS --verbose do gem install bundler
35
+ - rvm $MRI_VERSIONS --verbose do bundle install
36
+ - rvm $MRI_VERSIONS --verbose do appraisal install
36
37
 
37
38
  test:
38
39
  override:
39
- - rvm 2.1.10 --verbose do rake rubocop
40
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do rake test
41
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails3-postgres rake rails
42
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails3-mysql2 rake rails
43
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails4-postgres rake rails
44
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails4-mysql2 rake rails
45
- - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake rails
46
- - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake rails
47
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails3-postgres-redis rake railsredis
48
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal rails4-postgres-redis rake railsredis
49
- - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake railsredis
50
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal contrib rake contrib
51
- - rvm $MRI_VERSIONS,$JRUBY_VERSIONS --verbose do appraisal contrib rake monkey
52
- - rvm 2.3.1 --verbose do rake benchmark
53
- - rvm jruby-9.1.5.0 --verbose do rake benchmark
40
+ - rvm $EARLY_STABLE --verbose do rake rubocop
41
+ # Disabled $JRUBY_VERSIONS tests because of a Java incompatibility
42
+ # TODO: integration tests should run with the master branch of the agent
43
+ - rvm $MRI_VERSIONS --verbose do rake test:main
44
+ - rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:monkey
45
+ - rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch
46
+ - rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http
47
+ - rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:redis
48
+ - rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra
49
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres rake test:rails
50
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails3-mysql2 rake test:rails
51
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres rake test:rails
52
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails4-mysql2 rake test:rails
53
+ - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:rails
54
+ - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake test:rails
55
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres-redis rake test:railsredis
56
+ - rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres-redis rake test:railsredis
57
+ - rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake test:railsredis
58
+ - rvm $LAST_STABLE --verbose do rake benchmark
54
59
 
55
60
  deployment:
56
61
  develop:
@@ -64,5 +69,3 @@ deployment:
64
69
  tag: /v[0-9]+(\.[0-9]+)*/
65
70
  commands:
66
71
  - S3_DIR=trace rake release:docs
67
- - S3_DIR=trace VERSION_SUFFIX= rake release:gem
68
- - cp -r ./rubygems/* $CIRCLE_ARTIFACTS
@@ -33,9 +33,8 @@ EOS
33
33
 
34
34
  spec.add_dependency "msgpack"
35
35
 
36
- spec.add_development_dependency "bundler", "~> 1.12"
37
- spec.add_development_dependency "rake", "~> 10.0"
38
- spec.add_development_dependency "rubocop", "~> 0.43"
39
- spec.add_development_dependency "minitest", "~> 5.0"
36
+ spec.add_development_dependency "rake", "~> 12.0"
37
+ spec.add_development_dependency "rubocop", "~> 0.47"
38
+ spec.add_development_dependency "minitest", "~> 5.10"
40
39
  spec.add_development_dependency "appraisal", "~> 2.1"
41
40
  end
@@ -7,19 +7,21 @@ databases and microservices so that developers have great visiblity into bottlen
7
7
 
8
8
  Install the tracer with the +gem+ command, but point to Datadog's gems repository:
9
9
 
10
- $ gem install ddtrace --source http://gems.datadoghq.com/trace/
10
+ $ gem install ddtrace
11
11
 
12
12
  On the other hand, if you're using +Bundler+, just update your +Gemfile+ as follows:
13
13
 
14
14
  source 'https://rubygems.org'
15
15
 
16
16
  # tracing gem
17
- gem 'ddtrace', :source => 'http://gems.datadoghq.com/trace/'
17
+ gem 'ddtrace'
18
+
19
+ If you're using the Ruby on Rails framework, you need to configure the auto-instrumentation with an {extra step}[#label-Auto+Instrumentation].
18
20
 
19
21
  == Quickstart (Auto Instrumentation)
20
22
 
21
23
  If you are on a {supported integration}[#label-Integrations], you should be able to generate traffic and view
22
- metrics in your {dashboard}[https://app.datadoghq.com/trace].
24
+ metrics listed in your service list.
23
25
 
24
26
  == Quickstart (Manual Instrumentation)
25
27
 
@@ -74,33 +76,23 @@ The \Rails integration will trace requests, database calls, templates rendering
74
76
  operations. The integration makes use of the Active Support Instrumentation, listening to the Notification API
75
77
  so that any operation instrumented by the API is traced.
76
78
 
77
- The supported versions are:
78
-
79
- * \Rails 3.2 (MRI interpreter, JRuby is experimental)
80
- * \Rails 4.2 (MRI interpreter, JRuby is experimental)
81
- * \Rails 5.0 (MRI interpreter)
82
-
83
- The currently supported web server are:
84
- * Puma 2.16+ and 3.6+
85
- * Unicorn 4.8+ and 5.1+
86
- * Passenger 5.0 (experimental)
87
-
88
- ==== Installation
79
+ ==== Auto Instrumentation
89
80
 
90
81
  Add the tracer gem to your +Gemfile+:
91
82
 
92
- gem 'ddtrace', :source => 'http://gems.datadoghq.com/trace/'
83
+ gem 'ddtrace'
93
84
 
94
- Now you can set your service name, simply creating an initializer file in your +config/+ folder:
85
+ To enable the Rails auto-instrumentation, you must create an initializer file in your +config/+ folder:
95
86
 
96
87
  # config/initializers/datadog-tracer.rb
97
88
 
98
89
  Rails.configuration.datadog_trace = {
99
- default_service: 'my-rails-app',
90
+ auto_instrument: true,
91
+ auto_instrument_redis: true,
92
+ default_service: 'my-rails-app'
100
93
  }
101
94
 
102
- If you're using \Rails 3 or higher, the auto-instrumentation will be automatically activated and no more configuration
103
- is required. Your application will be listed as +my-rails-app+ in your {dashboard}[https://app.datadoghq.com/trace].
95
+ If you're using \Rails 3 or higher, your application will be listed as +my-rails-app+ in your service list.
104
96
 
105
97
  ==== Custom Instrumentation
106
98
 
@@ -133,8 +125,8 @@ of the Datadog tracer, you can override the following defaults:
133
125
 
134
126
  Rails.configuration.datadog_trace = {
135
127
  enabled: true,
136
- auto_instrument: true,
137
- auto_instrument_redis: true,
128
+ auto_instrument: false,
129
+ auto_instrument_redis: false,
138
130
  default_service: 'rails-app',
139
131
  default_cache_service: 'rails-cache',
140
132
  template_base_path: 'views/',
@@ -146,13 +138,12 @@ of the Datadog tracer, you can override the following defaults:
146
138
 
147
139
  The available settings are:
148
140
 
149
- * +enabled+: defines if the +tracer+ is enabled or not. If set to +false+, the code is still instrumented
150
- but no spans are sent to the local trace agent.
151
- * +auto_instrument+: if set to false the code will not be instrumented, while the +tracer+ may be active for
152
- your internal usage. This could be useful if you want to use the \Rails integration, but you want to trace
153
- only particular functions or views
154
- * +auto_instrument_redis+: if set to false \Redis calls will not be traced as such. Calls to cache will
155
- still be instrumented but you will not have the detail of low-level \Redis calls.
141
+ * +enabled+: defines if the +tracer+ is enabled or not. If set to +false+ the code could be still instrumented
142
+ because of other settings, but no spans are sent to the local trace agent.
143
+ * +auto_instrument+: if set to +true+ the code will be automatically instrumented. You may change this value
144
+ with a condition, to enable the auto-instrumentation only for particular environments (production, staging, etc...).
145
+ * +auto_instrument_redis+: if set to +true+ \Redis calls will be traced as such. Calls to Redis cache may be
146
+ still instrumented but you will not have the detail of low-level \Redis calls.
156
147
  * +default_service+: set the service name used when tracing application requests. Defaults to +rails-app+
157
148
  * +default_database_service+: set the database service name used when tracing database activity. Defaults to the
158
149
  current adapter name, so if you're using PostgreSQL it will be +postgres+.
@@ -165,27 +156,55 @@ The available settings are:
165
156
  * +trace_agent_hostname+: set the hostname of the trace agent.
166
157
  * +trace_agent_port+: set the port the trace agent is listening on.
167
158
 
168
- === Redis
159
+ === Sinatra
169
160
 
170
- The \Redis integration will trace simple calls as well as pipelines.
161
+ The Sinatra integration traces requests and template rendering. The
162
+ integration is based on the +Datadog::Contrib::Sinatra::Tracer+ extension.
171
163
 
172
- require 'redis'
164
+ ==== Setup
165
+
166
+ Add the tracer gem to your +Gemfile+:
167
+
168
+ gem 'ddtrace'
169
+
170
+ Make sure you import +ddtrace+ and +ddtrace/contrib/sinatra/tracer+ after
171
+ either +sinatra+ or +sinatra/base+:
172
+
173
+ require 'sinatra'
173
174
  require 'ddtrace'
175
+ require 'ddtrace/contrib/sinatra/tracer'
174
176
 
175
- Datadog::Monkey.patch_module(:redis) # you need to explicitly patch it
177
+ The tracing extension will be automatically activated.
176
178
 
177
- # now do your Redis stuff, eg:
178
- redis = Redis.new
179
- redis.set 'foo', 'bar' # traced!
179
+ ==== Configuration
180
+
181
+ To modify the default configuration, use the
182
+ +settings.datadog_tracer.configure+ method. For example, to change the default
183
+ service name and activate the debug mode:
180
184
 
181
- The \patch_module allows you to enable tracing on a per-library basis.
182
- If you want to enable tracing for all supported integrations, you can simply
183
- use \patch_all eg:
185
+ configure do
186
+ settings.datadog_tracer.configure default_service: 'my-app', debug: true
187
+ end
188
+
189
+ The available settings are:
190
+
191
+ * +enabled+: define if the +tracer+ is enabled or not. If set to +false+, the code is still instrumented
192
+ but no spans are sent to the local trace agent.
193
+ * +default_service+: set the service name used when tracing application requests. Defaults to +sinatra+
194
+ * +tracer+: set the tracer to use. Usually you don't need to change that value
195
+ unless you're already using a different initialized tracer somewhere else
196
+ * +debug+: set to +true+ to enable debug logging.
197
+ * +trace_agent_hostname+: set the hostname of the trace agent.
198
+ * +trace_agent_port+: set the port the trace agent is listening on.
199
+
200
+ === Redis
201
+
202
+ The \Redis integration will trace simple calls as well as pipelines.
184
203
 
185
204
  require 'redis'
186
205
  require 'ddtrace'
187
206
 
188
- Datadog::Monkey.patch_all # enables all available integrations
207
+ Datadog::Monkey.patch_module(:redis) # you need to explicitly patch it
189
208
 
190
209
  # now do your Redis stuff, eg:
191
210
  redis = Redis.new
@@ -205,18 +224,26 @@ in the \Client object:
205
224
  client = Elasticsearch::Client.new url: 'http://127.0.0.1:9200'
206
225
  response = client.perform_request 'GET', '_cluster/health'
207
226
 
208
- The \patch_module allows you to enable tracing on a per-library basis.
209
- If you want to enable tracing for all supported integrations, you can simply
210
- use \patch_all eg:
227
+ Note that if you enable both \Elasticsearch and \Net/HTTP integrations then
228
+ for each call, two spans are created, one for \Elasctisearch and one for \Net/HTTP.
229
+ This typically happens if you call \patch_all to enable all integrations by default.
211
230
 
212
- require 'elasticsearch/transport'
231
+ === Net/HTTP
232
+
233
+ The \Net/HTTP integration will trace any HTTP call using the standard lib
234
+ \Net::HTTP module.
235
+
236
+ require 'net/http'
213
237
  require 'ddtrace'
214
238
 
215
- Datadog::Monkey.patch_all # enables all available integrations
239
+ Datadog::Monkey.patch_module(:http) # you need to explicitly patch it
216
240
 
217
- # now do your Elastic Search stuff, eg:
218
- client = Elasticsearch::Client.new url: 'http://127.0.0.1:9200'
219
- response = client.perform_request 'GET', '_cluster/health'
241
+ Net::HTTP.start('127.0.0.1', 8080) do |http|
242
+ request = Net::HTTP::Get.new '/index'
243
+ response = http.request request
244
+ end
245
+
246
+ content = Net::HTTP.get(URI('http://127.0.0.1/index.html'))
220
247
 
221
248
  == Monkey Patching
222
249
 
@@ -230,7 +257,7 @@ The available methods are:
230
257
  the key is the name of the module and the value \true or \false. If it is \true,
231
258
  a call to \patch_all will enable the module, if it is \false, it will do nothing.
232
259
  * +patch_all+: patches all modules which are supported. Make sure all the necessary
233
- calls to \require have been done before this is alled, else monkey patching will
260
+ calls to \require have been done before this is called, else monkey patching will
234
261
  not work.
235
262
  * +patch_module+: patches a single module, regardless of its settings in the
236
263
  \autopatch_modules list.
@@ -347,6 +374,24 @@ The \Datadog Trace Client has been tested with the following Ruby versions:
347
374
  * Ruby MRI 2.1
348
375
  * Ruby MRI 2.2
349
376
  * Ruby MRI 2.3
377
+ * Ruby MRI 2.4
350
378
  * JRuby 9.1.5 (experimental)
351
379
 
352
380
  Other versions aren't yet officially supported.
381
+
382
+ === Rails support
383
+
384
+ The supported versions are:
385
+
386
+ * \Rails 3.2 (MRI interpreter, JRuby is experimental)
387
+ * \Rails 4.2 (MRI interpreter, JRuby is experimental)
388
+ * \Rails 5.0 (MRI interpreter)
389
+
390
+ The currently supported web server are:
391
+ * Puma 2.16+ and 3.6+
392
+ * Unicorn 4.8+ and 5.1+
393
+ * Passenger 5.0+
394
+
395
+ === Sinatra support
396
+
397
+ Currently we are supporting Sinatra >= 1.4.0.