ddtrace 0.12.0.beta2 → 0.12.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +8 -8
  3. data/CHANGELOG.md +293 -0
  4. data/README.md +11 -114
  5. data/Rakefile +26 -18
  6. data/docs/GettingStarted.md +704 -453
  7. data/gemfiles/contrib.gemfile +2 -2
  8. data/gemfiles/rails4_mysql2.gemfile +1 -1
  9. data/gemfiles/rails5_mysql2.gemfile +2 -2
  10. data/gemfiles/rails5_postgres.gemfile +1 -1
  11. data/gemfiles/rails5_postgres_redis.gemfile +1 -1
  12. data/gemfiles/rails5_postgres_sidekiq.gemfile +1 -1
  13. data/lib/ddtrace.rb +1 -0
  14. data/lib/ddtrace/context.rb +96 -34
  15. data/lib/ddtrace/context_flush.rb +132 -0
  16. data/lib/ddtrace/contrib/active_record/patcher.rb +55 -70
  17. data/lib/ddtrace/contrib/active_record/utils.rb +83 -0
  18. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +66 -0
  19. data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +155 -0
  20. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +6 -1
  21. data/lib/ddtrace/contrib/elasticsearch/quantize.rb +89 -0
  22. data/lib/ddtrace/contrib/grape/endpoint.rb +1 -1
  23. data/lib/ddtrace/contrib/racecar/patcher.rb +43 -19
  24. data/lib/ddtrace/contrib/rack/middlewares.rb +58 -11
  25. data/lib/ddtrace/contrib/rack/patcher.rb +18 -11
  26. data/lib/ddtrace/contrib/rails/action_controller.rb +9 -11
  27. data/lib/ddtrace/contrib/rails/action_view.rb +5 -1
  28. data/lib/ddtrace/contrib/rails/active_support.rb +6 -2
  29. data/lib/ddtrace/contrib/rails/core_extensions.rb +280 -215
  30. data/lib/ddtrace/contrib/rails/framework.rb +38 -23
  31. data/lib/ddtrace/contrib/rails/middlewares.rb +7 -2
  32. data/lib/ddtrace/contrib/rails/patcher.rb +9 -6
  33. data/lib/ddtrace/contrib/rails/railtie.rb +4 -2
  34. data/lib/ddtrace/contrib/rails/utils.rb +9 -40
  35. data/lib/ddtrace/patcher.rb +32 -10
  36. data/lib/ddtrace/quantization/http.rb +86 -0
  37. data/lib/ddtrace/tracer.rb +29 -2
  38. data/lib/ddtrace/transport.rb +33 -20
  39. data/lib/ddtrace/version.rb +1 -1
  40. data/lib/ddtrace/writer.rb +11 -5
  41. metadata +8 -3
  42. data/lib/ddtrace/contrib/rails/active_record.rb +0 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b305364b957464fbf947cf98b60242c359b0d268
4
- data.tar.gz: 35cb93abf500727238c80f5591c70d11a2c8319c
3
+ metadata.gz: f73d39bda4233aa96ad4c0a5537ca45c7a682721
4
+ data.tar.gz: b494960dadd540e1c5bc0b1b2ca810cc0878477e
5
5
  SHA512:
6
- metadata.gz: dd9b7e6ccaf05a45d7644720c1b697beac322ea3f93d94e97766ce245d9f341fdbc7bab79631cd6a7bca6b77f341f0925f3d47c2ae31452b3ad0280e2082a741
7
- data.tar.gz: 31026dda215416a05dd539bde6ae0bd57690e7a8dc0279992830e493739aa30c2ebb763ed42238d7b572db9e5602833d150d78bfbadc714365f867f9485d9655
6
+ metadata.gz: c78b30912aa1776417fc5a073791e3b527adb042831110b5d5fe4e1e7d42bb5a031fbbb899bfe0b35ffeec28bc14fe475747aefe4bce6effe26ec48c765393e0
7
+ data.tar.gz: 849cc865358ed3b9c171ad74f50609a8a4b57b532df97e2b7da408dfbfc40bf9646a0a8e4bd83e68953d88533e03a7798846fb9543dabbebca35f1663aae5645
data/Appraisals CHANGED
@@ -57,7 +57,7 @@ if RUBY_VERSION < '2.4.0' && RUBY_PLATFORM != 'java'
57
57
  if RUBY_VERSION >= '2.1.10'
58
58
  appraise 'rails4-mysql2' do
59
59
  gem 'rails', '4.2.7.1'
60
- gem 'mysql2', platform: :ruby
60
+ gem 'mysql2', '< 0.5', platform: :ruby
61
61
  gem 'activerecord-jdbcmysql-adapter', platform: :jruby
62
62
  end
63
63
 
@@ -78,24 +78,24 @@ if RUBY_VERSION < '2.4.0' && RUBY_PLATFORM != 'java'
78
78
 
79
79
  if RUBY_VERSION >= '2.2.2'
80
80
  appraise 'rails5-mysql2' do
81
- gem 'rails', '5.0.1'
82
- gem 'mysql2', platform: :ruby
81
+ gem 'rails', '5.1.5'
82
+ gem 'mysql2', '< 0.5', platform: :ruby
83
83
  end
84
84
 
85
85
  appraise 'rails5-postgres' do
86
- gem 'rails', '5.0.1'
86
+ gem 'rails', '5.1.5'
87
87
  gem 'pg', '< 1.0', platform: :ruby
88
88
  end
89
89
 
90
90
  appraise 'rails5-postgres-redis' do
91
- gem 'rails', '5.0.1'
91
+ gem 'rails', '5.1.5'
92
92
  gem 'pg', '< 1.0', platform: :ruby
93
93
  gem 'redis-rails'
94
94
  gem 'redis'
95
95
  end
96
96
 
97
97
  appraise 'rails5-postgres-sidekiq' do
98
- gem 'rails', '5.0.1'
98
+ gem 'rails', '5.1.5'
99
99
  gem 'pg', '< 1.0', platform: :ruby
100
100
  gem 'sidekiq'
101
101
  gem 'activejob'
@@ -123,14 +123,14 @@ if RUBY_VERSION >= '2.2.2' && RUBY_PLATFORM != 'java'
123
123
  gem 'hiredis'
124
124
  gem 'sinatra'
125
125
  gem 'sqlite3'
126
- gem 'activerecord'
126
+ gem 'activerecord', '< 5.1.5'
127
127
  gem 'sidekiq'
128
128
  gem 'aws-sdk'
129
129
  gem 'sucker_punch'
130
130
  gem 'dalli'
131
131
  gem 'resque', '< 2.0'
132
132
  gem 'racecar', '>= 0.3.5'
133
- gem 'mysql2', platform: :ruby
133
+ gem 'mysql2', '< 0.5', platform: :ruby
134
134
  end
135
135
  else
136
136
  appraise 'contrib-old' do
@@ -0,0 +1,293 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased (stable)]
4
+
5
+ ## [Unreleased (beta)]
6
+
7
+ ## [0.12.0.rc1] - 2018-04-11
8
+
9
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.rc1
10
+
11
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
12
+
13
+ ### Added
14
+ - GraphQL integration (supporting graphql 1.7.9+) (#295)
15
+ - ActiveRecord object instantiation tracing (#311, #334)
16
+ - Subscriber module for ActiveSupport::Notifications tracing (#324, #380, #390, #395) (@dasch)
17
+ - HTTP quantization module (#384)
18
+ - Partial flushing option to tracer (#247, #397)
19
+
20
+ ### Changed
21
+ - Rack applies URL quantization by default (#371)
22
+ - Elasticsearch applies body quantization by default (#362)
23
+ - Context for a single trace now has hard limit of 100,000 spans (#247)
24
+ - Tags with `rails.db.x` to `active_record.db.x` instead (#396)
25
+
26
+ ### Fixed
27
+ - Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
28
+ - Some scenarios where `middleware_names` could result in bad resource names (#354)
29
+ - ActionController instrumentation conflicting with some gems that monkey patch Rails (#391)
30
+
31
+ ### Deprecated
32
+ - Use of `:datadog_rack_request_span` variable in favor of `'datadog.rack_request_span'` in Rack. (#365, #392)
33
+
34
+ ### Refactored
35
+ - Racecar to use ActiveSupport::Notifications Subscriber module (#381)
36
+ - Rails to use ActiveRecord integration instead of its own implementation (#396)
37
+ - ActiveRecord to use ActiveSupport::Notifications Subscriber module (#396)
38
+
39
+ ## [0.12.0.beta2] - 2018-02-28
40
+
41
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.beta2
42
+
43
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
44
+
45
+ ### Fixed
46
+ - Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
47
+
48
+ ## [0.12.0.beta1] - 2018-02-09
49
+
50
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.beta1
51
+
52
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.12.0.beta1
53
+
54
+ ### Added
55
+ - GraphQL integration (supporting graphql 1.7.9+) (#295)
56
+ - ActiveRecord object instantiation tracing (#311, #334)
57
+ - `http.request_id` tag to Rack spans (#335)
58
+
59
+ ## [0.11.4] - 2018-03-29
60
+
61
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.4
62
+
63
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.3...v0.11.4
64
+
65
+ ### Fixed
66
+ - Transport body parsing when downgrading (#369)
67
+ - Transport incorrectly attempting to apply sampling to service metadata (#370)
68
+ - `sql.active_record` traces showing incorrect adapter settings when non-default adapter used (#383)
69
+
70
+ ## [0.11.3] - 2018-03-06
71
+
72
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.3
73
+
74
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.11.3
75
+
76
+ ### Added
77
+ - CHANGELOG.md (#350, #363) (@awendt)
78
+ - `http.request_id` tag to Rack spans (#335)
79
+ - Tracer configuration to README.md (#332) (@noma4i)
80
+
81
+ ### Fixed
82
+ - Extra indentation in README.md (#349) (@ck3g)
83
+ - `http.url` when Rails raises exceptions (#351, #353)
84
+ - Rails from being patched twice (#352)
85
+ - 4XX responses from middleware being marked as errors (#345)
86
+ - Rails exception middleware sometimes not being inserted at correct position (#345)
87
+ - Processing pipeline documentation typo (#355) (@MMartyn)
88
+ - Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
89
+ - Use of block syntax with Rails `render` not working (#359, #360) (@dorner)
90
+
91
+ ## [0.11.2] - 2018-02-02
92
+
93
+ **Critical update**: `Datadog::Monkey` removed in version 0.11.1. Adds `Datadog::Monkey` back as no-op, deprecated module.
94
+
95
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.2
96
+
97
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.1...v0.11.2
98
+
99
+ ### Deprecated
100
+ - `Datadog::Monkey` to be no-op and print deprecation warnings.
101
+
102
+ ## [0.11.1] - 2018-01-29
103
+
104
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.1
105
+
106
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.0...v0.11.1
107
+
108
+ ### Added
109
+ - `http.base_url` tag for Rack applications (#301, #327)
110
+ - `distributed_tracing` option to Sinatra (#325)
111
+ - `exception_controller` option to Rails (#320)
112
+
113
+ ### Changed
114
+ - Decoupled Sinatra and ActiveRecord integrations (#328, #330) (@hawknewton)
115
+ - Racecar uses preferred ActiveSupport::Notifications strategy (#323)
116
+
117
+ ### Removed
118
+ - `Datadog::Monkey` in favor of newer configuration API (#322)
119
+
120
+ ### Fixed
121
+ - Custom resource names from Rails controllers being overridden (#321)
122
+ - Custom Rails exception controllers reporting as the resource (#320)
123
+
124
+ ## [0.11.0] - 2018-01-17
125
+
126
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0
127
+
128
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.10.0...v0.11.0
129
+
130
+ ## [0.11.0.beta2] - 2017-12-27
131
+
132
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0.beta2
133
+
134
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.0.beta1...v0.11.0.beta2
135
+
136
+ ## [0.11.0.beta1] - 2017-12-04
137
+
138
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0.beta1
139
+
140
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.10.0...v0.11.0.beta1
141
+
142
+ ## [0.10.0] - 2017-11-30
143
+
144
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.10.0
145
+
146
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.9.2...v0.10.0
147
+
148
+ ## [0.9.2] - 2017-11-03
149
+
150
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.9.2
151
+
152
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.9.1...v0.9.2
153
+
154
+ ## [0.9.1] - 2017-11-02
155
+
156
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.9.1
157
+
158
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.9.0...v0.9.1
159
+
160
+ ## [0.9.0] - 2017-10-06
161
+
162
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.9.0
163
+
164
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.8.2...v0.9.0
165
+
166
+ ## [0.8.2] - 2017-09-08
167
+
168
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.8.2
169
+
170
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.8.1...v0.8.2
171
+
172
+ ## [0.8.1] - 2017-08-10
173
+
174
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.8.1
175
+
176
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.8.0...v0.8.1
177
+
178
+ ## [0.8.0] - 2017-07-24
179
+
180
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.8.0
181
+
182
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.7.2...v0.8.0
183
+
184
+ ## [0.7.2] - 2017-05-24
185
+
186
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.7.2
187
+
188
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.7.1...v0.7.2
189
+
190
+ ## [0.7.1] - 2017-05-10
191
+
192
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.7.1
193
+
194
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.7.0...v0.7.1
195
+
196
+ ## [0.7.0] - 2017-04-24
197
+
198
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.7.0
199
+
200
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.6.2...v0.7.0
201
+
202
+ ## [0.6.2] - 2017-04-07
203
+
204
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.6.2
205
+
206
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.6.1...v0.6.2
207
+
208
+ ## [0.6.1] - 2017-04-05
209
+
210
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.6.1
211
+
212
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.6.0...v0.6.1
213
+
214
+ ## [0.6.0] - 2017-03-28
215
+
216
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.6.0
217
+
218
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.5.0...v0.6.0
219
+
220
+ ## [0.5.0] - 2017-03-08
221
+
222
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.5.0
223
+
224
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.4.3...v0.5.0
225
+
226
+ ## [0.4.3] - 2017-02-17
227
+
228
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.4.3
229
+
230
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.4.2...v0.4.3
231
+
232
+ ## [0.4.2] - 2017-02-14
233
+
234
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.4.2
235
+
236
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.4.1...v0.4.2
237
+
238
+ ## [0.4.1] - 2017-02-14
239
+
240
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.4.1
241
+
242
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.4.0...v0.4.1
243
+
244
+ ## [0.4.0] - 2017-01-24
245
+
246
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.4.0
247
+
248
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.1...v0.4.0
249
+
250
+ ## [0.3.1] - 2017-01-23
251
+
252
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
253
+
254
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
255
+
256
+ [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...master
257
+ [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.rc1...0.12-dev
258
+ [0.12.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
259
+ [0.12.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
260
+ [0.12.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.12.0.beta1
261
+ [0.11.4]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.3...v0.11.4
262
+ [0.11.3]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.11.3
263
+ [0.11.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.1...v0.11.2
264
+ [0.11.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.0...v0.11.1
265
+ [0.11.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.10.0...v0.11.0
266
+ [0.11.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.0.beta1...v0.11.0.beta2
267
+ [0.11.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v0.10.0...v0.11.0.beta1
268
+ [0.10.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.9.2...v0.10.0
269
+ [0.9.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.9.1...v0.9.2
270
+ [0.9.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.9.0...v0.9.1
271
+ [0.9.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.8.2...v0.9.0
272
+ [0.8.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.8.1...v0.8.2
273
+ [0.8.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.8.0...v0.8.1
274
+ [0.8.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.7.2...v0.8.0
275
+ [0.7.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.7.1...v0.7.2
276
+ [0.7.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.7.0...v0.7.1
277
+ [0.7.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.6.2...v0.7.0
278
+ [0.6.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.6.1...v0.6.2
279
+ [0.6.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.6.0...v0.6.1
280
+ [0.6.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.5.0...v0.6.0
281
+ [0.5.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.4.3...v0.5.0
282
+ [0.4.3]: https://github.com/DataDog/dd-trace-rb/compare/v0.4.2...v0.4.3
283
+ [0.4.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.4.1...v0.4.2
284
+ [0.4.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.4.0...v0.4.1
285
+ [0.4.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.3.1...v0.4.0
286
+ [0.3.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
287
+ [0.3.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.2.0...v0.3.0
288
+ [0.2.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.5...v0.2.0
289
+ [0.1.5]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.4...v0.1.5
290
+ [0.1.4]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.3...v0.1.4
291
+ [0.1.3]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.2...v0.1.3
292
+ [0.1.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.1...v0.1.2
293
+ [0.1.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.1.0...v0.1.1
data/README.md CHANGED
@@ -1,109 +1,22 @@
1
- # dd-trace-rb
1
+ # Datadog Trace Client
2
2
 
3
3
  [![CircleCI](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master.svg?style=svg&circle-token=b0bd5ef866ec7f7b018f48731bb495f2d1372cc1)](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master)
4
4
 
5
- ## Documentation
6
-
7
- You can find the latest documentation on [rubydoc.info][docs]
8
-
9
- [docs]: http://gems.datadoghq.com/trace/docs/
5
+ ``ddtrace`` is Datadog’s tracing client for Ruby. It is used to trace requests as they flow across web servers,
6
+ databases and microservices so that developers have great visiblity into bottlenecks and troublesome requests.
10
7
 
11
8
  ## Getting started
12
9
 
13
- ### Install
14
-
15
- Install the Ruby client with the ``gem`` command:
16
-
17
- gem install ddtrace
18
-
19
- If you're using ``Bundler``, just update your ``Gemfile`` as follows:
20
-
21
- ```ruby
22
- source 'https://rubygems.org'
23
-
24
- # tracing gem
25
- gem 'ddtrace'
26
- ```
27
-
28
- To use a development/preview version, use:
29
-
30
- ```ruby
31
- gem 'ddtrace', :github => 'DataDog/dd-trace-rb', :branch => 'me/my-feature-branch'
32
- ```
33
-
34
- ### Quickstart (manual instrumentation)
35
-
36
- If you aren't using a supported framework instrumentation, you may want to to manually instrument your code.
37
- Adding tracing to your code is very simple. As an example, let’s imagine we have a web server and we want
38
- to trace requests to the home page:
39
-
40
- ```ruby
41
- require 'ddtrace'
42
- require 'sinatra'
43
- require 'active_record'
10
+ For a basic product overview, check out our [setup documentation][setup docs].
44
11
 
45
- # a generic tracer that you can use across your application
46
- tracer = Datadog.tracer
12
+ For installation, configuration, and details about using the API, check out our [API documentation][api docs] and [gem documentation][gem docs].
47
13
 
48
- get '/' do
49
- tracer.trace('web.request') do |span|
50
- # set some span metadata
51
- span.service = 'my-web-site'
52
- span.resource = '/'
53
- span.set_tag('http.method', request.request_method)
14
+ For descriptions of terminology used in APM, take a look at the [official documentation][visualization docs].
54
15
 
55
- # trace the activerecord call
56
- tracer.trace('posts.fetch') do
57
- @posts = Posts.order(created_at: :desc).limit(10)
58
- end
59
-
60
- # trace the template rendering
61
- tracer.trace('template.render') do
62
- erb :index
63
- end
64
- end
65
- end
66
- ```
67
-
68
- ### Quickstart (integration)
69
-
70
- Instead of doing the above manually, whenever an integration is available,
71
- you can activate it. The example above would become:
72
-
73
- ```ruby
74
- require 'ddtrace'
75
- require 'sinatra'
76
- require 'active_record'
77
-
78
- Datadog.configure do |c|
79
- c.use :sinatra
80
- c.use :active_record
81
- end
82
-
83
- # now write your code naturally, it's traced automatically
84
- get '/' do
85
- @posts = Posts.order(created_at: :desc).limit(10)
86
- erb :index
87
- end
88
- ```
89
-
90
- This will automatically trace any app inherited from `Sinatra::Application`.
91
- To trace apps inherited from `Sinatra::Base`, you should manually register
92
- the tracer inside your class.
93
-
94
- ```ruby
95
- require "ddtrace"
96
- require "ddtrace/contrib/sinatra/tracer"
97
-
98
- class App < Sinatra::Base
99
- register Datadog::Contrib::Sinatra::Tracer
100
- end
101
- ```
102
-
103
- To know if a given framework or lib is supported by our client,
104
- please consult our [integrations][contrib] list.
105
-
106
- [contrib]: http://www.rubydoc.info/github/DataDog/dd-trace-rb/Datadog/Contrib
16
+ [setup docs]: https://docs.datadoghq.com/tracing/setup/ruby/
17
+ [api docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md
18
+ [gem docs]: http://gems.datadoghq.com/trace/docs/
19
+ [visualization docs]: https://docs.datadoghq.com/tracing/visualization/
107
20
 
108
21
  ## Development
109
22
 
@@ -122,23 +35,7 @@ You can launch tests using the following Rake commands:
122
35
  ...
123
36
 
124
37
  Run ``rake --tasks`` for the list of available Rake tasks.
125
-
126
- Available appraisals are:
127
-
128
- * ``contrib``: default for integrations
129
- * ``contrib-old``: default for integrations, with version suited for old Ruby (possibly unmaintained) versions
130
- * ``rails3-mysql2``: Rails3 with Mysql
131
- * ``rails3-postgres``: Rails 3 with Postgres
132
- * ``rails3-postgres-redis``: Rails 3 with Postgres and Redis
133
- * ``rails3-postgres-sidekiq``: Rails 3 with Postgres and Sidekiq
134
- * ``rails4-mysql2``: Rails4 with Mysql
135
- * ``rails4-postgres``: Rails 4 with Postgres
136
- * ``rails4-postgres-redis``: Rails 4 with Postgres and Redis
137
- * ``rails4-postgres-sidekiq``: Rails 4 with Postgres and Sidekiq
138
- * ``rails5-mysql2``: Rails5 with Mysql
139
- * ``rails5-postgres``: Rails 5 with Postgres
140
- * ``rails5-postgres-redis``: Rails 5 with Postgres and Redis
141
- * ``rails5-postgres-sidekiq``: Rails 5 with Postgres and Sidekiq
38
+ Run ``appraisal list`` for the list of available appraisals.
142
39
 
143
40
  The test suite requires many backing services (PostgreSQL, MySQL, Redis, ...) and we're using
144
41
  ``docker`` and ``docker-compose`` to start these services in the CI.