ddtrace 0.13.0 → 0.14.0
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.
- checksums.yaml +5 -5
- data/.circleci/config.yml +88 -6
- data/.rubocop.yml +10 -0
- data/Appraisals +24 -0
- data/CHANGELOG.md +108 -2
- data/Gemfile +1 -0
- data/Rakefile +32 -2
- data/benchmarks/postgres_database.yml +9 -0
- data/benchmarks/sidekiq_test.rb +154 -0
- data/ddtrace.gemspec +3 -0
- data/docs/GettingStarted.md +127 -6
- data/lib/ddtrace/configuration.rb +19 -7
- data/lib/ddtrace/context.rb +8 -0
- data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +46 -0
- data/lib/ddtrace/contrib/active_record/configuration/settings.rb +28 -0
- data/lib/ddtrace/contrib/active_record/events/sql.rb +11 -7
- data/lib/ddtrace/contrib/active_record/integration.rb +44 -0
- data/lib/ddtrace/contrib/active_record/patcher.rb +4 -28
- data/lib/ddtrace/contrib/active_record/utils.rb +5 -11
- data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +2 -1
- data/lib/ddtrace/contrib/base.rb +4 -3
- data/lib/ddtrace/contrib/configurable.rb +55 -0
- data/lib/ddtrace/contrib/configuration/option.rb +33 -0
- data/lib/ddtrace/contrib/configuration/option_definition.rb +29 -0
- data/lib/ddtrace/contrib/configuration/option_definition_set.rb +20 -0
- data/lib/ddtrace/contrib/configuration/option_set.rb +8 -0
- data/lib/ddtrace/contrib/configuration/options.rb +95 -0
- data/lib/ddtrace/contrib/configuration/resolver.rb +12 -0
- data/lib/ddtrace/contrib/configuration/settings.rb +35 -0
- data/lib/ddtrace/contrib/delayed_job/patcher.rb +41 -0
- data/lib/ddtrace/contrib/delayed_job/plugin.rb +43 -0
- data/lib/ddtrace/contrib/integration.rb +16 -0
- data/lib/ddtrace/contrib/patchable.rb +38 -0
- data/lib/ddtrace/contrib/patcher.rb +28 -0
- data/lib/ddtrace/contrib/rack/middlewares.rb +34 -15
- data/lib/ddtrace/contrib/rake/instrumentation.rb +15 -3
- data/lib/ddtrace/contrib/registerable.rb +33 -0
- data/lib/ddtrace/contrib/resque/resque_job.rb +2 -10
- data/lib/ddtrace/contrib/rest_client/configuration/settings.rb +22 -0
- data/lib/ddtrace/contrib/rest_client/integration.rb +27 -0
- data/lib/ddtrace/contrib/rest_client/patcher.rb +25 -0
- data/lib/ddtrace/contrib/rest_client/request_patch.rb +90 -0
- data/lib/ddtrace/contrib/sequel/configuration/settings.rb +13 -0
- data/lib/ddtrace/contrib/sequel/database.rb +1 -1
- data/lib/ddtrace/contrib/sequel/integration.rb +38 -0
- data/lib/ddtrace/contrib/sequel/patcher.rb +4 -20
- data/lib/ddtrace/monkey.rb +0 -7
- data/lib/ddtrace/patcher.rb +5 -0
- data/lib/ddtrace/pin.rb +1 -1
- data/lib/ddtrace/propagation/http_propagator.rb +6 -0
- data/lib/ddtrace/span.rb +0 -1
- data/lib/ddtrace/tracer.rb +22 -5
- data/lib/ddtrace/vendor/active_record/connection_specification.rb +301 -0
- data/lib/ddtrace/version.rb +1 -1
- data/lib/ddtrace/workers.rb +6 -4
- data/lib/ddtrace/writer.rb +4 -5
- data/lib/ddtrace.rb +7 -15
- metadata +57 -3
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
require 'uri'
|
|
2
|
+
|
|
3
|
+
# NOTE: This code is copied directly from ActiveRecord.
|
|
4
|
+
# Its purpose is to resolve connection information.
|
|
5
|
+
# It exists here only because it doesn't exist in Rails 3.2.
|
|
6
|
+
# When support for Rails 3.2 is dropped, this can be removed.
|
|
7
|
+
module Datadog
|
|
8
|
+
module Vendor
|
|
9
|
+
module ActiveRecord
|
|
10
|
+
# Copy/paste from:
|
|
11
|
+
# https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/connection_handling.rb
|
|
12
|
+
module ConnectionHandling
|
|
13
|
+
RAILS_ENV = -> { (Rails.env if defined?(Rails) && defined?(Rails.env)) || ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Copy/paste from:
|
|
17
|
+
# https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/connection_adapters/connection_specification.rb
|
|
18
|
+
module ConnectionAdapters
|
|
19
|
+
class ConnectionSpecification
|
|
20
|
+
attr_reader :name, :config, :adapter_method
|
|
21
|
+
|
|
22
|
+
def initialize(name, config, adapter_method)
|
|
23
|
+
@name, @config, @adapter_method = name, config, adapter_method
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def initialize_dup(original)
|
|
27
|
+
@config = original.config.dup
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def to_hash
|
|
31
|
+
@config.merge(name: @name)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Expands a connection string into a hash.
|
|
35
|
+
class ConnectionUrlResolver # :nodoc:
|
|
36
|
+
# == Example
|
|
37
|
+
#
|
|
38
|
+
# url = "postgresql://foo:bar@localhost:9000/foo_test?pool=5&timeout=3000"
|
|
39
|
+
# ConnectionUrlResolver.new(url).to_hash
|
|
40
|
+
# # => {
|
|
41
|
+
# "adapter" => "postgresql",
|
|
42
|
+
# "host" => "localhost",
|
|
43
|
+
# "port" => 9000,
|
|
44
|
+
# "database" => "foo_test",
|
|
45
|
+
# "username" => "foo",
|
|
46
|
+
# "password" => "bar",
|
|
47
|
+
# "pool" => "5",
|
|
48
|
+
# "timeout" => "3000"
|
|
49
|
+
# }
|
|
50
|
+
def initialize(url)
|
|
51
|
+
raise "Database URL cannot be empty" if url.blank?
|
|
52
|
+
@uri = uri_parser.parse(url)
|
|
53
|
+
@adapter = @uri.scheme && @uri.scheme.tr("-", "_")
|
|
54
|
+
@adapter = "postgresql" if @adapter == "postgres"
|
|
55
|
+
|
|
56
|
+
if @uri.opaque
|
|
57
|
+
@uri.opaque, @query = @uri.opaque.split("?", 2)
|
|
58
|
+
else
|
|
59
|
+
@query = @uri.query
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Converts the given URL to a full connection hash.
|
|
64
|
+
def to_hash
|
|
65
|
+
config = raw_config.reject { |_, value| value.blank? }
|
|
66
|
+
config.map { |key, value| config[key] = uri_parser.unescape(value) if value.is_a? String }
|
|
67
|
+
config
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
private
|
|
71
|
+
|
|
72
|
+
def uri
|
|
73
|
+
@uri
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def uri_parser
|
|
77
|
+
@uri_parser ||= URI::Parser.new
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Converts the query parameters of the URI into a hash.
|
|
81
|
+
#
|
|
82
|
+
# "localhost?pool=5&reaping_frequency=2"
|
|
83
|
+
# # => { "pool" => "5", "reaping_frequency" => "2" }
|
|
84
|
+
#
|
|
85
|
+
# returns empty hash if no query present.
|
|
86
|
+
#
|
|
87
|
+
# "localhost"
|
|
88
|
+
# # => {}
|
|
89
|
+
def query_hash
|
|
90
|
+
Hash[(@query || "").split("&").map { |pair| pair.split("=") }]
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def raw_config
|
|
94
|
+
if uri.opaque
|
|
95
|
+
query_hash.merge(
|
|
96
|
+
"adapter" => @adapter,
|
|
97
|
+
"database" => uri.opaque)
|
|
98
|
+
else
|
|
99
|
+
query_hash.merge(
|
|
100
|
+
"adapter" => @adapter,
|
|
101
|
+
"username" => uri.user,
|
|
102
|
+
"password" => uri.password,
|
|
103
|
+
"port" => uri.port,
|
|
104
|
+
"database" => database_from_path,
|
|
105
|
+
"host" => uri.hostname)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Returns name of the database.
|
|
110
|
+
def database_from_path
|
|
111
|
+
if @adapter == "sqlite3"
|
|
112
|
+
# 'sqlite3:/foo' is absolute, because that makes sense. The
|
|
113
|
+
# corresponding relative version, 'sqlite3:foo', is handled
|
|
114
|
+
# elsewhere, as an "opaque".
|
|
115
|
+
|
|
116
|
+
uri.path
|
|
117
|
+
else
|
|
118
|
+
# Only SQLite uses a filename as the "database" name; for
|
|
119
|
+
# anything else, a leading slash would be silly.
|
|
120
|
+
|
|
121
|
+
uri.path.sub(%r{^/}, "")
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
##
|
|
127
|
+
# Builds a ConnectionSpecification from user input.
|
|
128
|
+
class Resolver # :nodoc:
|
|
129
|
+
attr_reader :configurations
|
|
130
|
+
|
|
131
|
+
# Accepts a hash two layers deep, keys on the first layer represent
|
|
132
|
+
# environments such as "production". Keys must be strings.
|
|
133
|
+
def initialize(configurations)
|
|
134
|
+
@configurations = configurations
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Returns a hash with database connection information.
|
|
138
|
+
#
|
|
139
|
+
# == Examples
|
|
140
|
+
#
|
|
141
|
+
# Full hash Configuration.
|
|
142
|
+
#
|
|
143
|
+
# configurations = { "production" => { "host" => "localhost", "database" => "foo", "adapter" => "sqlite3" } }
|
|
144
|
+
# Resolver.new(configurations).resolve(:production)
|
|
145
|
+
# # => { "host" => "localhost", "database" => "foo", "adapter" => "sqlite3"}
|
|
146
|
+
#
|
|
147
|
+
# Initialized with URL configuration strings.
|
|
148
|
+
#
|
|
149
|
+
# configurations = { "production" => "postgresql://localhost/foo" }
|
|
150
|
+
# Resolver.new(configurations).resolve(:production)
|
|
151
|
+
# # => { "host" => "localhost", "database" => "foo", "adapter" => "postgresql" }
|
|
152
|
+
#
|
|
153
|
+
def resolve(config)
|
|
154
|
+
if config
|
|
155
|
+
resolve_connection config
|
|
156
|
+
elsif env = ConnectionHandling::RAILS_ENV.call
|
|
157
|
+
resolve_symbol_connection env.to_sym
|
|
158
|
+
else
|
|
159
|
+
raise AdapterNotSpecified
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Expands each key in @configurations hash into fully resolved hash
|
|
164
|
+
def resolve_all
|
|
165
|
+
config = configurations.dup
|
|
166
|
+
|
|
167
|
+
if env = ConnectionHandling::DEFAULT_ENV.call
|
|
168
|
+
env_config = config[env] if config[env].is_a?(Hash) && !(config[env].key?("adapter") || config[env].key?("url"))
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
config.reject! { |k, v| v.is_a?(Hash) && !(v.key?("adapter") || v.key?("url")) }
|
|
172
|
+
config.merge! env_config if env_config
|
|
173
|
+
|
|
174
|
+
config.each do |key, value|
|
|
175
|
+
config[key] = resolve(value) if value
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
config
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns an instance of ConnectionSpecification for a given adapter.
|
|
182
|
+
# Accepts a hash one layer deep that contains all connection information.
|
|
183
|
+
#
|
|
184
|
+
# == Example
|
|
185
|
+
#
|
|
186
|
+
# config = { "production" => { "host" => "localhost", "database" => "foo", "adapter" => "sqlite3" } }
|
|
187
|
+
# spec = Resolver.new(config).spec(:production)
|
|
188
|
+
# spec.adapter_method
|
|
189
|
+
# # => "sqlite3_connection"
|
|
190
|
+
# spec.config
|
|
191
|
+
# # => { "host" => "localhost", "database" => "foo", "adapter" => "sqlite3" }
|
|
192
|
+
#
|
|
193
|
+
def spec(config)
|
|
194
|
+
spec = resolve(config).symbolize_keys
|
|
195
|
+
|
|
196
|
+
raise(AdapterNotSpecified, "database configuration does not specify adapter") unless spec.key?(:adapter)
|
|
197
|
+
|
|
198
|
+
# Require the adapter itself and give useful feedback about
|
|
199
|
+
# 1. Missing adapter gems and
|
|
200
|
+
# 2. Adapter gems' missing dependencies.
|
|
201
|
+
path_to_adapter = "active_record/connection_adapters/#{spec[:adapter]}_adapter"
|
|
202
|
+
begin
|
|
203
|
+
require path_to_adapter
|
|
204
|
+
rescue LoadError => e
|
|
205
|
+
# We couldn't require the adapter itself. Raise an exception that
|
|
206
|
+
# points out config typos and missing gems.
|
|
207
|
+
if e.path == path_to_adapter
|
|
208
|
+
# We can assume that a non-builtin adapter was specified, so it's
|
|
209
|
+
# either misspelled or missing from Gemfile.
|
|
210
|
+
raise e.class, "Could not load the '#{spec[:adapter]}' Active Record adapter. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile.", e.backtrace
|
|
211
|
+
|
|
212
|
+
# Bubbled up from the adapter require. Prefix the exception message
|
|
213
|
+
# with some guidance about how to address it and reraise.
|
|
214
|
+
else
|
|
215
|
+
raise e.class, "Error loading the '#{spec[:adapter]}' Active Record adapter. Missing a gem it depends on? #{e.message}", e.backtrace
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
adapter_method = "#{spec[:adapter]}_connection"
|
|
220
|
+
|
|
221
|
+
unless ::ActiveRecord::Base.respond_to?(adapter_method)
|
|
222
|
+
raise AdapterNotFound, "database configuration specifies nonexistent #{spec.config[:adapter]} adapter"
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
ConnectionSpecification.new(spec.delete(:name) || "primary", spec, adapter_method)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
private
|
|
229
|
+
|
|
230
|
+
# Returns fully resolved connection, accepts hash, string or symbol.
|
|
231
|
+
# Always returns a hash.
|
|
232
|
+
#
|
|
233
|
+
# == Examples
|
|
234
|
+
#
|
|
235
|
+
# Symbol representing current environment.
|
|
236
|
+
#
|
|
237
|
+
# Resolver.new("production" => {}).resolve_connection(:production)
|
|
238
|
+
# # => {}
|
|
239
|
+
#
|
|
240
|
+
# One layer deep hash of connection values.
|
|
241
|
+
#
|
|
242
|
+
# Resolver.new({}).resolve_connection("adapter" => "sqlite3")
|
|
243
|
+
# # => { "adapter" => "sqlite3" }
|
|
244
|
+
#
|
|
245
|
+
# Connection URL.
|
|
246
|
+
#
|
|
247
|
+
# Resolver.new({}).resolve_connection("postgresql://localhost/foo")
|
|
248
|
+
# # => { "host" => "localhost", "database" => "foo", "adapter" => "postgresql" }
|
|
249
|
+
#
|
|
250
|
+
def resolve_connection(spec)
|
|
251
|
+
case spec
|
|
252
|
+
when Symbol
|
|
253
|
+
resolve_symbol_connection spec
|
|
254
|
+
when String
|
|
255
|
+
resolve_url_connection spec
|
|
256
|
+
when Hash
|
|
257
|
+
resolve_hash_connection spec
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Takes the environment such as +:production+ or +:development+.
|
|
262
|
+
# This requires that the @configurations was initialized with a key that
|
|
263
|
+
# matches.
|
|
264
|
+
#
|
|
265
|
+
# Resolver.new("production" => {}).resolve_symbol_connection(:production)
|
|
266
|
+
# # => {}
|
|
267
|
+
#
|
|
268
|
+
def resolve_symbol_connection(spec)
|
|
269
|
+
if config = configurations[spec.to_s]
|
|
270
|
+
resolve_connection(config).merge("name" => spec.to_s)
|
|
271
|
+
else
|
|
272
|
+
raise(AdapterNotSpecified, "'#{spec}' database is not configured. Available: #{configurations.keys.inspect}")
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Accepts a hash. Expands the "url" key that contains a
|
|
277
|
+
# URL database connection to a full connection
|
|
278
|
+
# hash and merges with the rest of the hash.
|
|
279
|
+
# Connection details inside of the "url" key win any merge conflicts
|
|
280
|
+
def resolve_hash_connection(spec)
|
|
281
|
+
if spec["url"] && spec["url"] !~ /^jdbc:/
|
|
282
|
+
connection_hash = resolve_url_connection(spec.delete("url"))
|
|
283
|
+
spec.merge!(connection_hash)
|
|
284
|
+
end
|
|
285
|
+
spec
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Takes a connection URL.
|
|
289
|
+
#
|
|
290
|
+
# Resolver.new({}).resolve_url_connection("postgresql://localhost/foo")
|
|
291
|
+
# # => { "host" => "localhost", "database" => "foo", "adapter" => "postgresql" }
|
|
292
|
+
#
|
|
293
|
+
def resolve_url_connection(url)
|
|
294
|
+
ConnectionUrlResolver.new(url).to_hash
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
data/lib/ddtrace/version.rb
CHANGED
data/lib/ddtrace/workers.rb
CHANGED
|
@@ -43,7 +43,7 @@ module Datadog
|
|
|
43
43
|
# ensures that the thread will not die because of an exception.
|
|
44
44
|
# TODO[manu]: findout the reason and reschedule the send if it's not
|
|
45
45
|
# a fatal exception
|
|
46
|
-
Datadog::Tracer.log.error("Error during traces flush: dropped #{
|
|
46
|
+
Datadog::Tracer.log.error("Error during traces flush: dropped #{traces.length} items. Cause: #{e}")
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -58,7 +58,7 @@ module Datadog
|
|
|
58
58
|
# ensures that the thread will not die because of an exception.
|
|
59
59
|
# TODO[manu]: findout the reason and reschedule the send if it's not
|
|
60
60
|
# a fatal exception
|
|
61
|
-
Datadog::Tracer.log.error("Error during services flush: dropped #{
|
|
61
|
+
Datadog::Tracer.log.error("Error during services flush: dropped #{services.length} items. Cause: #{e}")
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -106,15 +106,17 @@ module Datadog
|
|
|
106
106
|
|
|
107
107
|
private
|
|
108
108
|
|
|
109
|
+
alias flush_data callback_traces
|
|
110
|
+
|
|
109
111
|
def perform
|
|
110
112
|
loop do
|
|
111
|
-
@back_off =
|
|
113
|
+
@back_off = flush_data ? @flush_interval : [@back_off * BACK_OFF_RATIO, BACK_OFF_MAX].min
|
|
112
114
|
|
|
113
115
|
callback_services
|
|
114
116
|
|
|
115
117
|
@mutex.synchronize do
|
|
116
118
|
return if !@run && @trace_buffer.empty? && @service_buffer.empty?
|
|
117
|
-
@shutdown.wait(@mutex, @back_off)
|
|
119
|
+
@shutdown.wait(@mutex, @back_off) if @run # do not wait when shutting down
|
|
118
120
|
end
|
|
119
121
|
end
|
|
120
122
|
end
|
data/lib/ddtrace/writer.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Datadog
|
|
|
7
7
|
class Writer
|
|
8
8
|
attr_reader :transport, :worker, :priority_sampler
|
|
9
9
|
|
|
10
|
-
HOSTNAME = '
|
|
10
|
+
HOSTNAME = '127.0.0.1'.freeze
|
|
11
11
|
PORT = '8126'.freeze
|
|
12
12
|
|
|
13
13
|
def initialize(options = {})
|
|
@@ -15,7 +15,6 @@ module Datadog
|
|
|
15
15
|
@buff_size = options.fetch(:buffer_size, 100)
|
|
16
16
|
@flush_interval = options.fetch(:flush_interval, 1)
|
|
17
17
|
transport_options = options.fetch(:transport_options, {})
|
|
18
|
-
|
|
19
18
|
# priority sampling
|
|
20
19
|
if options[:priority_sampler]
|
|
21
20
|
@priority_sampler = options[:priority_sampler]
|
|
@@ -95,10 +94,10 @@ module Datadog
|
|
|
95
94
|
# This check ensures that if a process doesn't own the current +Writer+, async workers
|
|
96
95
|
# will be initialized again (but only once for each process).
|
|
97
96
|
pid = Process.pid
|
|
98
|
-
@
|
|
99
|
-
|
|
97
|
+
if pid != @pid # avoid using Mutex when pids are equal
|
|
98
|
+
@mutex_after_fork.synchronize do
|
|
100
99
|
# we should start threads because the worker doesn't own this
|
|
101
|
-
start
|
|
100
|
+
start if pid != @pid
|
|
102
101
|
end
|
|
103
102
|
end
|
|
104
103
|
|
data/lib/ddtrace.rb
CHANGED
|
@@ -14,6 +14,7 @@ require 'ddtrace/patcher'
|
|
|
14
14
|
module Datadog
|
|
15
15
|
@tracer = Tracer.new
|
|
16
16
|
@registry = Registry.new
|
|
17
|
+
@configuration = Configuration.new(registry: @registry)
|
|
17
18
|
|
|
18
19
|
# Default tracer that can be used as soon as +ddtrace+ is required:
|
|
19
20
|
#
|
|
@@ -28,21 +29,9 @@ module Datadog
|
|
|
28
29
|
# tracer = Datadog::Tracer.new
|
|
29
30
|
# pin = Datadog::Pin.get_from(mypatchcomponent)
|
|
30
31
|
# pin.tracer = tracer
|
|
31
|
-
|
|
32
|
-
def self.tracer
|
|
33
|
-
@tracer
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def self.registry
|
|
37
|
-
@registry
|
|
38
|
-
end
|
|
39
|
-
|
|
40
32
|
class << self
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def configuration
|
|
44
|
-
@configuration ||= Configuration.new
|
|
45
|
-
end
|
|
33
|
+
attr_reader :tracer, :registry
|
|
34
|
+
attr_accessor :configuration
|
|
46
35
|
|
|
47
36
|
def configure(target = configuration, opts = {})
|
|
48
37
|
if target.is_a?(Configuration)
|
|
@@ -55,10 +44,11 @@ module Datadog
|
|
|
55
44
|
end
|
|
56
45
|
|
|
57
46
|
require 'ddtrace/contrib/base'
|
|
47
|
+
require 'ddtrace/contrib/integration'
|
|
58
48
|
require 'ddtrace/contrib/rack/patcher'
|
|
59
49
|
require 'ddtrace/contrib/rails/patcher'
|
|
60
50
|
require 'ddtrace/contrib/active_model_serializers/patcher'
|
|
61
|
-
require 'ddtrace/contrib/active_record/
|
|
51
|
+
require 'ddtrace/contrib/active_record/integration'
|
|
62
52
|
require 'ddtrace/contrib/sequel/patcher'
|
|
63
53
|
require 'ddtrace/contrib/elasticsearch/patcher'
|
|
64
54
|
require 'ddtrace/contrib/faraday/patcher'
|
|
@@ -69,10 +59,12 @@ require 'ddtrace/contrib/redis/patcher'
|
|
|
69
59
|
require 'ddtrace/contrib/http/patcher'
|
|
70
60
|
require 'ddtrace/contrib/aws/patcher'
|
|
71
61
|
require 'ddtrace/contrib/sucker_punch/patcher'
|
|
62
|
+
require 'ddtrace/contrib/rest_client/integration'
|
|
72
63
|
require 'ddtrace/contrib/mongodb/patcher'
|
|
73
64
|
require 'ddtrace/contrib/dalli/patcher'
|
|
74
65
|
require 'ddtrace/contrib/rake/patcher'
|
|
75
66
|
require 'ddtrace/contrib/resque/patcher'
|
|
67
|
+
require 'ddtrace/contrib/delayed_job/patcher'
|
|
76
68
|
require 'ddtrace/contrib/racecar/patcher'
|
|
77
69
|
require 'ddtrace/contrib/sidekiq/patcher'
|
|
78
70
|
require 'ddtrace/contrib/excon/patcher'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ddtrace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Datadog, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: msgpack
|
|
@@ -150,6 +150,34 @@ dependencies:
|
|
|
150
150
|
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: ruby-prof
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - ">="
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '0'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - ">="
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: sqlite3
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
153
181
|
- !ruby/object:Gem::Dependency
|
|
154
182
|
name: addressable
|
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -235,6 +263,8 @@ files:
|
|
|
235
263
|
- LICENSE
|
|
236
264
|
- README.md
|
|
237
265
|
- Rakefile
|
|
266
|
+
- benchmarks/postgres_database.yml
|
|
267
|
+
- benchmarks/sidekiq_test.rb
|
|
238
268
|
- ddtrace.gemspec
|
|
239
269
|
- docker-compose.yml
|
|
240
270
|
- docs/GettingStarted.md
|
|
@@ -252,10 +282,13 @@ files:
|
|
|
252
282
|
- lib/ddtrace/contrib/active_model_serializers/events/render.rb
|
|
253
283
|
- lib/ddtrace/contrib/active_model_serializers/events/serialize.rb
|
|
254
284
|
- lib/ddtrace/contrib/active_model_serializers/patcher.rb
|
|
285
|
+
- lib/ddtrace/contrib/active_record/configuration/resolver.rb
|
|
286
|
+
- lib/ddtrace/contrib/active_record/configuration/settings.rb
|
|
255
287
|
- lib/ddtrace/contrib/active_record/event.rb
|
|
256
288
|
- lib/ddtrace/contrib/active_record/events.rb
|
|
257
289
|
- lib/ddtrace/contrib/active_record/events/instantiation.rb
|
|
258
290
|
- lib/ddtrace/contrib/active_record/events/sql.rb
|
|
291
|
+
- lib/ddtrace/contrib/active_record/integration.rb
|
|
259
292
|
- lib/ddtrace/contrib/active_record/patcher.rb
|
|
260
293
|
- lib/ddtrace/contrib/active_record/utils.rb
|
|
261
294
|
- lib/ddtrace/contrib/active_support/notifications/event.rb
|
|
@@ -266,9 +299,19 @@ files:
|
|
|
266
299
|
- lib/ddtrace/contrib/aws/patcher.rb
|
|
267
300
|
- lib/ddtrace/contrib/aws/services.rb
|
|
268
301
|
- lib/ddtrace/contrib/base.rb
|
|
302
|
+
- lib/ddtrace/contrib/configurable.rb
|
|
303
|
+
- lib/ddtrace/contrib/configuration/option.rb
|
|
304
|
+
- lib/ddtrace/contrib/configuration/option_definition.rb
|
|
305
|
+
- lib/ddtrace/contrib/configuration/option_definition_set.rb
|
|
306
|
+
- lib/ddtrace/contrib/configuration/option_set.rb
|
|
307
|
+
- lib/ddtrace/contrib/configuration/options.rb
|
|
308
|
+
- lib/ddtrace/contrib/configuration/resolver.rb
|
|
309
|
+
- lib/ddtrace/contrib/configuration/settings.rb
|
|
269
310
|
- lib/ddtrace/contrib/dalli/instrumentation.rb
|
|
270
311
|
- lib/ddtrace/contrib/dalli/patcher.rb
|
|
271
312
|
- lib/ddtrace/contrib/dalli/quantize.rb
|
|
313
|
+
- lib/ddtrace/contrib/delayed_job/patcher.rb
|
|
314
|
+
- lib/ddtrace/contrib/delayed_job/plugin.rb
|
|
272
315
|
- lib/ddtrace/contrib/elasticsearch/patcher.rb
|
|
273
316
|
- lib/ddtrace/contrib/elasticsearch/quantize.rb
|
|
274
317
|
- lib/ddtrace/contrib/excon/middleware.rb
|
|
@@ -284,11 +327,14 @@ files:
|
|
|
284
327
|
- lib/ddtrace/contrib/grpc/intercept_with_datadog.rb
|
|
285
328
|
- lib/ddtrace/contrib/grpc/patcher.rb
|
|
286
329
|
- lib/ddtrace/contrib/http/patcher.rb
|
|
330
|
+
- lib/ddtrace/contrib/integration.rb
|
|
287
331
|
- lib/ddtrace/contrib/mongodb/parsers.rb
|
|
288
332
|
- lib/ddtrace/contrib/mongodb/patcher.rb
|
|
289
333
|
- lib/ddtrace/contrib/mongodb/subscribers.rb
|
|
290
334
|
- lib/ddtrace/contrib/mysql2/client.rb
|
|
291
335
|
- lib/ddtrace/contrib/mysql2/patcher.rb
|
|
336
|
+
- lib/ddtrace/contrib/patchable.rb
|
|
337
|
+
- lib/ddtrace/contrib/patcher.rb
|
|
292
338
|
- lib/ddtrace/contrib/racecar/event.rb
|
|
293
339
|
- lib/ddtrace/contrib/racecar/events.rb
|
|
294
340
|
- lib/ddtrace/contrib/racecar/events/batch.rb
|
|
@@ -312,10 +358,17 @@ files:
|
|
|
312
358
|
- lib/ddtrace/contrib/redis/patcher.rb
|
|
313
359
|
- lib/ddtrace/contrib/redis/quantize.rb
|
|
314
360
|
- lib/ddtrace/contrib/redis/tags.rb
|
|
361
|
+
- lib/ddtrace/contrib/registerable.rb
|
|
315
362
|
- lib/ddtrace/contrib/resque/patcher.rb
|
|
316
363
|
- lib/ddtrace/contrib/resque/resque_job.rb
|
|
364
|
+
- lib/ddtrace/contrib/rest_client/configuration/settings.rb
|
|
365
|
+
- lib/ddtrace/contrib/rest_client/integration.rb
|
|
366
|
+
- lib/ddtrace/contrib/rest_client/patcher.rb
|
|
367
|
+
- lib/ddtrace/contrib/rest_client/request_patch.rb
|
|
368
|
+
- lib/ddtrace/contrib/sequel/configuration/settings.rb
|
|
317
369
|
- lib/ddtrace/contrib/sequel/database.rb
|
|
318
370
|
- lib/ddtrace/contrib/sequel/dataset.rb
|
|
371
|
+
- lib/ddtrace/contrib/sequel/integration.rb
|
|
319
372
|
- lib/ddtrace/contrib/sequel/patcher.rb
|
|
320
373
|
- lib/ddtrace/contrib/sequel/utils.rb
|
|
321
374
|
- lib/ddtrace/contrib/sidekiq/patcher.rb
|
|
@@ -362,6 +415,7 @@ files:
|
|
|
362
415
|
- lib/ddtrace/transport.rb
|
|
363
416
|
- lib/ddtrace/utils.rb
|
|
364
417
|
- lib/ddtrace/utils/database.rb
|
|
418
|
+
- lib/ddtrace/vendor/active_record/connection_specification.rb
|
|
365
419
|
- lib/ddtrace/version.rb
|
|
366
420
|
- lib/ddtrace/workers.rb
|
|
367
421
|
- lib/ddtrace/writer.rb
|
|
@@ -386,7 +440,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
386
440
|
version: '0'
|
|
387
441
|
requirements: []
|
|
388
442
|
rubyforge_project:
|
|
389
|
-
rubygems_version: 2.
|
|
443
|
+
rubygems_version: 2.7.7
|
|
390
444
|
signing_key:
|
|
391
445
|
specification_version: 4
|
|
392
446
|
summary: Datadog tracing code for your Ruby applications
|