ddtrace 0.46.0 → 0.47.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +52 -12
- data/.circleci/images/primary/{Dockerfile-jruby-9.2 → Dockerfile-jruby-9.2-latest} +2 -1
- data/.circleci/images/primary/Dockerfile-jruby-9.2.0.0 +73 -0
- data/.circleci/images/primary/Dockerfile-truffleruby-21.0.0 +73 -0
- data/.github/workflows/create-next-milestone.yml +2 -2
- data/.rubocop_todo.yml +3 -2
- data/.simplecov +6 -0
- data/Appraisals +1 -1
- data/CHANGELOG.md +83 -1
- data/Gemfile +19 -4
- data/LICENSE-3rdparty.csv +2 -0
- data/docker-compose.yml +75 -7
- data/docs/GettingStarted.md +61 -8
- data/lib/ddtrace/configuration.rb +92 -23
- data/lib/ddtrace/configuration/options.rb +2 -4
- data/lib/ddtrace/context_provider.rb +0 -2
- data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +97 -26
- data/lib/ddtrace/contrib/aws/services.rb +1 -0
- data/lib/ddtrace/contrib/configurable.rb +63 -39
- data/lib/ddtrace/contrib/configuration/resolver.rb +70 -5
- data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +19 -17
- data/lib/ddtrace/contrib/configuration/settings.rb +7 -6
- data/lib/ddtrace/contrib/elasticsearch/patcher.rb +1 -0
- data/lib/ddtrace/contrib/extensions.rb +26 -3
- data/lib/ddtrace/contrib/httpclient/instrumentation.rb +12 -16
- data/lib/ddtrace/contrib/httpclient/patcher.rb +5 -2
- data/lib/ddtrace/contrib/httprb/instrumentation.rb +12 -17
- data/lib/ddtrace/contrib/httprb/patcher.rb +5 -2
- data/lib/ddtrace/contrib/patcher.rb +8 -5
- data/lib/ddtrace/contrib/presto/patcher.rb +5 -2
- data/lib/ddtrace/contrib/rails/patcher.rb +6 -2
- data/lib/ddtrace/contrib/redis/configuration/resolver.rb +11 -4
- data/lib/ddtrace/contrib/resque/integration.rb +1 -1
- data/lib/ddtrace/ext/runtime.rb +2 -0
- data/lib/ddtrace/patcher.rb +23 -1
- data/lib/ddtrace/pin.rb +5 -9
- data/lib/ddtrace/runtime/cgroup.rb +1 -1
- data/lib/ddtrace/runtime/container.rb +25 -27
- data/lib/ddtrace/runtime/identity.rb +8 -0
- data/lib/ddtrace/sync_writer.rb +5 -2
- data/lib/ddtrace/tracer.rb +6 -4
- data/lib/ddtrace/transport/http.rb +14 -5
- data/lib/ddtrace/transport/http/adapters/net.rb +18 -4
- data/lib/ddtrace/transport/http/builder.rb +5 -1
- data/lib/ddtrace/transport/http/env.rb +8 -0
- data/lib/ddtrace/transport/io/response.rb +1 -3
- data/lib/ddtrace/transport/io/traces.rb +6 -0
- data/lib/ddtrace/transport/traces.rb +15 -1
- data/lib/ddtrace/utils/compression.rb +27 -0
- data/lib/ddtrace/utils/object_set.rb +41 -0
- data/lib/ddtrace/utils/only_once.rb +40 -0
- data/lib/ddtrace/utils/sequence.rb +17 -0
- data/lib/ddtrace/utils/string_table.rb +45 -0
- data/lib/ddtrace/utils/time.rb +7 -0
- data/lib/ddtrace/vendor/multipart-post/LICENSE +11 -0
- data/lib/ddtrace/vendor/multipart-post/multipart.rb +12 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +8 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +116 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +57 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +135 -0
- data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +9 -0
- data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +32 -0
- data/lib/ddtrace/version.rb +1 -1
- data/lib/ddtrace/workers/async.rb +3 -3
- data/lib/ddtrace/workers/loop.rb +14 -3
- data/lib/ddtrace/workers/queue.rb +1 -0
- data/lib/ddtrace/workers/trace_writer.rb +1 -0
- data/lib/ddtrace/writer.rb +4 -1
- metadata +21 -4
data/lib/ddtrace/version.rb
CHANGED
@@ -18,7 +18,7 @@ module Datadog
|
|
18
18
|
# Methods that must be prepended
|
19
19
|
module PrependedMethods
|
20
20
|
def perform(*args)
|
21
|
-
|
21
|
+
start_async { self.result = super(*args) } unless started?
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -105,7 +105,7 @@ module Datadog
|
|
105
105
|
@worker ||= nil
|
106
106
|
end
|
107
107
|
|
108
|
-
def
|
108
|
+
def start_async(&block)
|
109
109
|
mutex.synchronize do
|
110
110
|
return if running?
|
111
111
|
|
@@ -126,7 +126,7 @@ module Datadog
|
|
126
126
|
@run_async = true
|
127
127
|
@pid = Process.pid
|
128
128
|
@error = nil
|
129
|
-
Datadog.logger.debug("Starting thread in the process: #{Process.pid}")
|
129
|
+
Datadog.logger.debug("Starting thread in the process: #{Process.pid} for: #{self}")
|
130
130
|
|
131
131
|
@worker = ::Thread.new do
|
132
132
|
begin
|
data/lib/ddtrace/workers/loop.rb
CHANGED
@@ -55,12 +55,21 @@ module Datadog
|
|
55
55
|
@loop_wait_time ||= loop_base_interval
|
56
56
|
end
|
57
57
|
|
58
|
+
def loop_wait_time=(value)
|
59
|
+
@loop_wait_time = value
|
60
|
+
end
|
61
|
+
|
62
|
+
def reset_loop_wait_time
|
63
|
+
self.loop_wait_time = loop_base_interval
|
64
|
+
end
|
65
|
+
|
66
|
+
# Should the loop "back off" when there's no work?
|
58
67
|
def loop_back_off?
|
59
68
|
false
|
60
69
|
end
|
61
70
|
|
62
|
-
def loop_back_off!
|
63
|
-
|
71
|
+
def loop_back_off!
|
72
|
+
self.loop_wait_time = [loop_wait_time * BACK_OFF_RATIO, BACK_OFF_MAX].min
|
64
73
|
end
|
65
74
|
|
66
75
|
protected
|
@@ -81,12 +90,14 @@ module Datadog
|
|
81
90
|
|
82
91
|
loop do
|
83
92
|
if work_pending?
|
93
|
+
# There's work to do...
|
84
94
|
# Run the task
|
85
95
|
yield
|
86
96
|
|
87
97
|
# Reset the wait interval
|
88
|
-
loop_back_off
|
98
|
+
reset_loop_wait_time if loop_back_off?
|
89
99
|
elsif loop_back_off?
|
100
|
+
# There's no work to do...
|
90
101
|
# Back off the wait interval a bit
|
91
102
|
loop_back_off!
|
92
103
|
end
|
data/lib/ddtrace/writer.rb
CHANGED
@@ -8,10 +8,13 @@ require 'ddtrace/transport/io'
|
|
8
8
|
require 'ddtrace/encoding'
|
9
9
|
require 'ddtrace/workers'
|
10
10
|
require 'ddtrace/diagnostics/environment_logger'
|
11
|
+
require 'ddtrace/utils/only_once'
|
11
12
|
|
12
13
|
module Datadog
|
13
14
|
# Processor that sends traces and metadata to the agent
|
14
15
|
class Writer
|
16
|
+
DEPRECATION_WARN_ONLY_ONCE = Datadog::Utils::OnlyOnce.new
|
17
|
+
|
15
18
|
attr_reader \
|
16
19
|
:priority_sampler,
|
17
20
|
:transport,
|
@@ -127,7 +130,7 @@ module Datadog
|
|
127
130
|
# enqueue the trace for submission to the API
|
128
131
|
def write(trace, services = nil)
|
129
132
|
unless services.nil?
|
130
|
-
|
133
|
+
DEPRECATION_WARN_ONLY_ONCE.run do
|
131
134
|
Datadog.logger.warn(%(
|
132
135
|
write: Writing services has been deprecated and no longer need to be provided.
|
133
136
|
write(traces, services) can be updated to write(traces)
|
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.47.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: 2021-03-
|
11
|
+
date: 2021-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -44,7 +44,9 @@ files:
|
|
44
44
|
- ".circleci/images/primary/Dockerfile-2.6.4"
|
45
45
|
- ".circleci/images/primary/Dockerfile-2.7.0"
|
46
46
|
- ".circleci/images/primary/Dockerfile-3.0.0"
|
47
|
-
- ".circleci/images/primary/Dockerfile-jruby-9.2"
|
47
|
+
- ".circleci/images/primary/Dockerfile-jruby-9.2-latest"
|
48
|
+
- ".circleci/images/primary/Dockerfile-jruby-9.2.0.0"
|
49
|
+
- ".circleci/images/primary/Dockerfile-truffleruby-21.0.0"
|
48
50
|
- ".dockerignore"
|
49
51
|
- ".env"
|
50
52
|
- ".github/CODEOWNERS"
|
@@ -62,6 +64,7 @@ files:
|
|
62
64
|
- CONTRIBUTING.md
|
63
65
|
- Gemfile
|
64
66
|
- LICENSE
|
67
|
+
- LICENSE-3rdparty.csv
|
65
68
|
- LICENSE.Apache
|
66
69
|
- LICENSE.BSD3
|
67
70
|
- NOTICE
|
@@ -623,11 +626,24 @@ files:
|
|
623
626
|
- lib/ddtrace/transport/statistics.rb
|
624
627
|
- lib/ddtrace/transport/traces.rb
|
625
628
|
- lib/ddtrace/utils.rb
|
629
|
+
- lib/ddtrace/utils/compression.rb
|
626
630
|
- lib/ddtrace/utils/database.rb
|
627
631
|
- lib/ddtrace/utils/forking.rb
|
632
|
+
- lib/ddtrace/utils/object_set.rb
|
633
|
+
- lib/ddtrace/utils/only_once.rb
|
634
|
+
- lib/ddtrace/utils/sequence.rb
|
635
|
+
- lib/ddtrace/utils/string_table.rb
|
628
636
|
- lib/ddtrace/utils/time.rb
|
629
637
|
- lib/ddtrace/vendor/active_record/MIT-LICENSE
|
630
638
|
- lib/ddtrace/vendor/active_record/connection_specification.rb
|
639
|
+
- lib/ddtrace/vendor/multipart-post/LICENSE
|
640
|
+
- lib/ddtrace/vendor/multipart-post/multipart.rb
|
641
|
+
- lib/ddtrace/vendor/multipart-post/multipart/post.rb
|
642
|
+
- lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb
|
643
|
+
- lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb
|
644
|
+
- lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb
|
645
|
+
- lib/ddtrace/vendor/multipart-post/multipart/post/version.rb
|
646
|
+
- lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb
|
631
647
|
- lib/ddtrace/version.rb
|
632
648
|
- lib/ddtrace/worker.rb
|
633
649
|
- lib/ddtrace/workers.rb
|
@@ -659,7 +675,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
659
675
|
- !ruby/object:Gem::Version
|
660
676
|
version: 2.0.0
|
661
677
|
requirements: []
|
662
|
-
|
678
|
+
rubyforge_project:
|
679
|
+
rubygems_version: 2.5.2.3
|
663
680
|
signing_key:
|
664
681
|
specification_version: 4
|
665
682
|
summary: Datadog tracing code for your Ruby applications
|