instrument_all_the_things 3.0.0.pre1 → 3.0.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
  SHA256:
3
- metadata.gz: 646446099c29d11b07d2269aa120da36fe2edf4d69127caddfa30638e901cdd4
4
- data.tar.gz: 3fc427a860c5d4e706c2af654fa4335fa6b006b312d0d96a85d68a103ee969b5
3
+ metadata.gz: d00660a82d059c7e7d56c9694ac46a8f50f5a1d13c3559ffc8b78cc2997602c9
4
+ data.tar.gz: 1a2120753598e6a3e04092ca63cc86abf2d34ca0ae9700d75be9f332b84cc280
5
5
  SHA512:
6
- metadata.gz: 87a7eb1cf0d1b69fcc019683d143dc03e8a3e02c6fae4b987a95df99b23cbd182f36ade45ee43072987129840a7594168cecddaca4fd0496d6a05e2545573604
7
- data.tar.gz: af9867f4bd3d7d343a55d46036d4606d686bda74f246c9283f9d789011fa3a1a9484fd27b8ca1231ebb9a5e5752ba3589ffdfac0c8f9318838830745ca031529
6
+ metadata.gz: ca8782def9281be9fb2592b3e0f4e2fe472dc3235dbeb73dfe04918b328efd02212fb7d2725ddfba93b92af8b9b1087e2b00ec97ec709e1eec5bddfb3bf69356
7
+ data.tar.gz: 8383f8a513bb2b88118a9a2607ebdc0722c82d65a9ef3dc42da3641a81cb26beeda64f310e04bfff1ef974a0d4bfd2706edef3a024de571a11da6ffb7de841f2
@@ -14,7 +14,7 @@ jobs:
14
14
  - 3.0.4
15
15
  - 2.7.6
16
16
  steps:
17
- - uses: actions/checkout@v2
17
+ - uses: actions/checkout@v3
18
18
  - uses: ruby/setup-ruby@v1
19
19
  with:
20
20
  ruby-version: ${{ matrix.ruby }}
data/.rubocop.yml CHANGED
@@ -8,6 +8,7 @@ AllCops:
8
8
  - vendor/**/*
9
9
  - bin/*
10
10
  - Guardfile
11
+ - lib/instrument_all_the_things/thread.rb
11
12
 
12
13
  Naming/AccessorMethodName:
13
14
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.0.2
2
+
3
+ Fixed `Thread.new_traced` to return a normal thread if there is no active trace
4
+
1
5
  # 1.2.0
2
6
 
3
7
  Remove unneeded kwargs option to support Ruby 3.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instrument_all_the_things (2.0.0)
4
+ instrument_all_the_things (3.0.0)
5
5
  ddtrace (~> 1.2.0)
6
6
  dogstatsd-ruby (~> 5.5.0)
7
7
 
@@ -28,16 +28,16 @@ GEM
28
28
  libddwaf (1.3.0.2.0-x86_64-darwin)
29
29
  ffi (~> 1.0)
30
30
  method_source (1.0.0)
31
- msgpack (1.5.3)
31
+ msgpack (1.6.0)
32
32
  parallel (1.22.1)
33
- parser (3.1.2.0)
33
+ parser (3.1.2.1)
34
34
  ast (~> 2.4.1)
35
35
  pry (0.14.1)
36
36
  coderay (~> 1.1)
37
37
  method_source (~> 1.0)
38
38
  rainbow (3.1.1)
39
39
  rake (10.5.0)
40
- regexp_parser (2.5.0)
40
+ regexp_parser (2.6.0)
41
41
  rexml (3.2.5)
42
42
  rspec (3.11.0)
43
43
  rspec-core (~> 3.11.0)
@@ -45,24 +45,24 @@ GEM
45
45
  rspec-mocks (~> 3.11.0)
46
46
  rspec-core (3.11.0)
47
47
  rspec-support (~> 3.11.0)
48
- rspec-expectations (3.11.0)
48
+ rspec-expectations (3.11.1)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
50
  rspec-support (~> 3.11.0)
51
51
  rspec-mocks (3.11.1)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
53
  rspec-support (~> 3.11.0)
54
- rspec-support (3.11.0)
55
- rubocop (1.31.2)
54
+ rspec-support (3.11.1)
55
+ rubocop (1.36.0)
56
56
  json (~> 2.3)
57
57
  parallel (~> 1.10)
58
- parser (>= 3.1.0.0)
58
+ parser (>= 3.1.2.1)
59
59
  rainbow (>= 2.2.2, < 4.0)
60
60
  regexp_parser (>= 1.8, < 3.0)
61
61
  rexml (>= 3.2.5, < 4.0)
62
- rubocop-ast (>= 1.18.0, < 2.0)
62
+ rubocop-ast (>= 1.20.1, < 2.0)
63
63
  ruby-progressbar (~> 1.7)
64
64
  unicode-display_width (>= 1.4.0, < 3.0)
65
- rubocop-ast (1.19.1)
65
+ rubocop-ast (1.21.0)
66
66
  parser (>= 3.1.1.0)
67
67
  ruby-progressbar (1.11.0)
68
68
  simplecov (0.21.2)
@@ -71,7 +71,7 @@ GEM
71
71
  simplecov_json_formatter (~> 0.1)
72
72
  simplecov-html (0.12.3)
73
73
  simplecov_json_formatter (0.1.4)
74
- unicode-display_width (2.2.0)
74
+ unicode-display_width (2.3.0)
75
75
 
76
76
  PLATFORMS
77
77
  ruby
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ddtrace'
4
+
5
+ # https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#between-threads
6
+ class Thread
7
+ def self.new_traced
8
+ trace = Datadog::Tracing.active_trace
9
+
10
+ if trace
11
+ trace_digest = trace.to_digest
12
+ Thread.new do |*args|
13
+ # Inherits trace properties from the trace digest
14
+ Datadog::Tracing.trace(trace.name, continue_from: trace_digest) do |_span, trace|
15
+ trace.id == trace_digest.trace_id
16
+ yield(*args)
17
+ end
18
+ end
19
+ else
20
+ Thread.new do |*args|
21
+ yield(*args)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstrumentAllTheThings
4
- VERSION = '3.0.0.pre1'
4
+ VERSION = '3.0.0'
5
5
  end
@@ -6,6 +6,7 @@ require 'instrument_all_the_things/version'
6
6
 
7
7
  require_relative './instrument_all_the_things/helpers'
8
8
  require_relative './instrument_all_the_things/clients/stat_reporter/datadog'
9
+ require_relative './instrument_all_the_things/thread'
9
10
 
10
11
  module InstrumentAllTheThings
11
12
  class Error < StandardError; end
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instrument_all_the_things
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Malinconico
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-12 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ddtrace
@@ -174,6 +174,7 @@ files:
174
174
  - lib/instrument_all_the_things/testing/rspec_matchers.rb
175
175
  - lib/instrument_all_the_things/testing/stat_tracker.rb
176
176
  - lib/instrument_all_the_things/testing/trace_tracker.rb
177
+ - lib/instrument_all_the_things/thread.rb
177
178
  - lib/instrument_all_the_things/version.rb
178
179
  - logo.jpg
179
180
  - vendor/cache/ast-2.4.2.gem
@@ -190,26 +191,26 @@ files:
190
191
  - vendor/cache/libddwaf-1.3.0.2.0-x86_64-darwin.gem
191
192
  - vendor/cache/libddwaf-1.3.0.2.0.gem
192
193
  - vendor/cache/method_source-1.0.0.gem
193
- - vendor/cache/msgpack-1.5.3.gem
194
+ - vendor/cache/msgpack-1.6.0.gem
194
195
  - vendor/cache/parallel-1.22.1.gem
195
- - vendor/cache/parser-3.1.2.0.gem
196
+ - vendor/cache/parser-3.1.2.1.gem
196
197
  - vendor/cache/pry-0.14.1.gem
197
198
  - vendor/cache/rainbow-3.1.1.gem
198
199
  - vendor/cache/rake-10.5.0.gem
199
- - vendor/cache/regexp_parser-2.5.0.gem
200
+ - vendor/cache/regexp_parser-2.6.0.gem
200
201
  - vendor/cache/rexml-3.2.5.gem
201
202
  - vendor/cache/rspec-3.11.0.gem
202
203
  - vendor/cache/rspec-core-3.11.0.gem
203
- - vendor/cache/rspec-expectations-3.11.0.gem
204
+ - vendor/cache/rspec-expectations-3.11.1.gem
204
205
  - vendor/cache/rspec-mocks-3.11.1.gem
205
- - vendor/cache/rspec-support-3.11.0.gem
206
- - vendor/cache/rubocop-1.31.2.gem
207
- - vendor/cache/rubocop-ast-1.19.1.gem
206
+ - vendor/cache/rspec-support-3.11.1.gem
207
+ - vendor/cache/rubocop-1.36.0.gem
208
+ - vendor/cache/rubocop-ast-1.21.0.gem
208
209
  - vendor/cache/ruby-progressbar-1.11.0.gem
209
210
  - vendor/cache/simplecov-0.21.2.gem
210
211
  - vendor/cache/simplecov-html-0.12.3.gem
211
212
  - vendor/cache/simplecov_json_formatter-0.1.4.gem
212
- - vendor/cache/unicode-display_width-2.2.0.gem
213
+ - vendor/cache/unicode-display_width-2.3.0.gem
213
214
  homepage: https://github.com/GetTerminus/instrument-all-the-things
214
215
  licenses: []
215
216
  metadata:
@@ -227,9 +228,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
228
  version: 2.7.0
228
229
  required_rubygems_version: !ruby/object:Gem::Requirement
229
230
  requirements:
230
- - - ">"
231
+ - - ">="
231
232
  - !ruby/object:Gem::Version
232
- version: 1.3.1
233
+ version: '0'
233
234
  requirements: []
234
235
  rubygems_version: 3.3.7
235
236
  signing_key:
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file