opentelemetry-instrumentation-resque 0.3.0 → 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
  SHA256:
3
- metadata.gz: 97330a63e02e03814520d6a664ae17db7d77e1d6a6c55099711da2034f872423
4
- data.tar.gz: 86c92282316dece9f34040720c88d18573872012e3693f60ed131ebdd35cb697
3
+ metadata.gz: 3de68fbde8d85fe64048f623302ca558d1b7f9d40055423ad78ad98de1b78fa6
4
+ data.tar.gz: ead9715d8295efe47c3c76dc45be70af570f0551f3dcdcc1b8b09b096829fa6d
5
5
  SHA512:
6
- metadata.gz: d2b77162dcbd2874d32b5f74f1ce0cb78d5a370662585e73ca9af586f7b2d3ab475858f442ef162f785d98c2fb1dc87b35f82b05f389a862a25954473085702b
7
- data.tar.gz: 375c7d171a1e37f21532f5d398df97ad7183862ddfa8c5121c27eecf90c20ad3932ef890f87dbdc5739153beaf141cecfec6b9566c427175a502a3685ab240e5
6
+ metadata.gz: ea3ba0e44b285739855a0853db2ee6cd8599ed58a3a591ad9922e04f5b0620c9741d774328852bf95b8727f0f42fa71aa9ebe22d04b983102b0b32a6daebde0b
7
+ data.tar.gz: a54a7f5c1e2b5b9d78242a2e13f0a21ade43c387f61e395a5da3464afc8927978a036c9856c8a6c951d7264048d22dd01a1fb5655ee95b5027464a9acd3c92fa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Release History: opentelemetry-instrumentation-resque
2
2
 
3
+ ### v0.4.0 / 2023-04-17
4
+
5
+ * BREAKING CHANGE: Drop support for EoL Ruby 2.7
6
+
7
+ * ADDED: Drop support for EoL Ruby 2.7
8
+ * ADDED: Add :force_flush option to Resque instrumentation
9
+ * FIXED: Fix flaky tests for resque.
10
+
11
+ ### v0.3.1 / 2023-01-14
12
+
13
+ * DOCS: Fix gem homepage
14
+ * DOCS: More gem documentation fixes
15
+
3
16
  ### v0.3.0 / 2022-06-09
4
17
 
5
18
  * Upgrading Base dependency version
data/README.md CHANGED
@@ -32,7 +32,7 @@ end
32
32
 
33
33
  ## Examples
34
34
 
35
- Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/resque/example/trace_demonstration.rb)
35
+ Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/resque/example/trace_demonstration.rb)
36
36
 
37
37
  ## How can I get involved?
38
38
 
@@ -47,7 +47,7 @@ The `opentelemetry-instrumentation-resque` gem is distributed under the Apache 2
47
47
  [resque-home]: https://github.com/resque/resque
48
48
  [bundler-home]: https://bundler.io
49
49
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
50
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
50
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
51
51
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
52
52
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
53
53
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -18,8 +18,33 @@ module OpenTelemetry
18
18
  defined?(::Resque)
19
19
  end
20
20
 
21
- option :span_naming, default: :queue, validate: %I[job_class queue]
22
- option :propagation_style, default: :link, validate: %i[link child none]
21
+ ## Supported configuration keys for the install config hash:
22
+ #
23
+ # force_flush: controls if spans are forcibly flushed upon job completion
24
+ # - :ask_the_job (default) - if `Resque::Worker#fork_per_job?` is set,
25
+ # all completed spans will be synchronously flushed at the end of a
26
+ # job's execution
27
+ # - :always - all completed spans will be synchronously flushed at the
28
+ # end of a job's execution
29
+ # - :never - the job will not intervene with the processing of spans
30
+ #
31
+ # span_naming: when `:job_class`, the span names will be set to
32
+ # '<job class name> <operation>'. When `:queue`, the span names
33
+ # will be set to '<destination / queue name> <operation>'
34
+ #
35
+ # propagation_style: controls how the job's execution is traced and related
36
+ # to the trace where the job was enqueued. Can be one of:
37
+ # - :link (default) - the job will be executed in a separate trace. The
38
+ # initial span of the execution trace will be linked to the span that
39
+ # enqueued the job, via a Span Link.
40
+ # - :child - the job will be executed in the same logical trace, as a direct
41
+ # child of the span that enqueued the job.
42
+ # - :none - the job's execution will not be explicitly linked to the span that
43
+ # enqueued the job.
44
+
45
+ option :force_flush, default: :ask_the_job, validate: %I[ask_the_job always never]
46
+ option :span_naming, default: :queue, validate: %I[job_class queue]
47
+ option :propagation_style, default: :link, validate: %i[link child none]
23
48
 
24
49
  private
25
50
 
@@ -10,12 +10,12 @@ module OpenTelemetry
10
10
  module Patches
11
11
  # Module to prepend to Resque::Job for instrumentation
12
12
  module ResqueJob
13
- def perform # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
13
+ def perform # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
14
14
  job_args = args || []
15
15
 
16
16
  # Check if the job is being wrapped by ActiveJob
17
17
  # before retrieving the job class name
18
- job_class = if payload_class_name == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && job_args[0]&.is_a?(Hash)
18
+ job_class = if payload_class_name == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && job_args[0].is_a?(Hash)
19
19
  job_args[0]['job_class']
20
20
  else
21
21
  payload_class_name
@@ -54,6 +54,11 @@ module OpenTelemetry
54
54
  end
55
55
  end
56
56
  end
57
+ ensure
58
+ if (config[:force_flush] == :ask_the_job && worker&.fork_per_job?) ||
59
+ config[:force_flush] == :always
60
+ OpenTelemetry.tracer_provider.force_flush
61
+ end
57
62
  end
58
63
 
59
64
  private
@@ -21,7 +21,7 @@ module OpenTelemetry
21
21
  def push(queue, item)
22
22
  # Check if the job is being wrapped by ActiveJob
23
23
  # before retrieving the job class name
24
- job_class = if item[:class] == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && item[:args][0]&.is_a?(Hash)
24
+ job_class = if item[:class] == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && item[:args][0].is_a?(Hash)
25
25
  item[:args][0]['job_class']
26
26
  else
27
27
  item[:class]
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Resque
10
- VERSION = '0.3.0'
10
+ VERSION = '0.4.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.21.0
33
+ version: 0.22.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.21.0
40
+ version: 0.22.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.17'
61
+ version: '2.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.17'
68
+ version: '2.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -98,30 +98,30 @@ dependencies:
98
98
  name: opentelemetry-test-helpers
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.3'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 12.3.3
117
+ version: '13.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 12.3.3
124
+ version: '13.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: resque
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.73.0
145
+ version: 1.48.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.73.0
152
+ version: 1.48.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -224,14 +224,14 @@ files:
224
224
  - lib/opentelemetry/instrumentation/resque/patches/resque_job.rb
225
225
  - lib/opentelemetry/instrumentation/resque/patches/resque_module.rb
226
226
  - lib/opentelemetry/instrumentation/resque/version.rb
227
- homepage: https://github.com/open-telemetry/opentelemetry-ruby
227
+ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
228
228
  licenses:
229
229
  - Apache-2.0
230
230
  metadata:
231
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-resque/v0.3.0/file.CHANGELOG.html
232
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/resque
233
- bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
234
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-resque/v0.3.0
231
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-resque/0.4.0/file/CHANGELOG.md
232
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/resque
233
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
234
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-resque/0.4.0
235
235
  post_install_message:
236
236
  rdoc_options: []
237
237
  require_paths:
@@ -240,14 +240,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - ">="
242
242
  - !ruby/object:Gem::Version
243
- version: 2.6.0
243
+ version: '3.0'
244
244
  required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  requirements:
246
246
  - - ">="
247
247
  - !ruby/object:Gem::Version
248
248
  version: '0'
249
249
  requirements: []
250
- rubygems_version: 3.1.6
250
+ rubygems_version: 3.2.33
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Resque instrumentation for the OpenTelemetry framework