opentelemetry-instrumentation-sidekiq 0.13.0 → 0.18.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: 06105b13c70190b459d650fff91f1f3052cb1e655cd744100aeee6475bbb5b8f
4
- data.tar.gz: 4b7142a06febd442ac3184270c0e73562a47ec252d5b7dc829d12d9863d7009f
3
+ metadata.gz: 4405583412d46b76cbc7f66b507f931946fdc4555b7ab571760efe72a185b341
4
+ data.tar.gz: 63c257bf5c9f033fc3b336fb4acb90ac61ddae10637bade6bc6c48cd08cb2011
5
5
  SHA512:
6
- metadata.gz: c5efbba5397bff170c7f8c1cf8deee5d3c7ecdd9e6b2fde14e8fffe6cff0f88f777c91b5dfed4bd96895af188015d4e18a581376f7cc52851a9ec7ab22821d21
7
- data.tar.gz: 422779d862bee296be58b695c11614bf5778648b9b009495ff9a3aea5f4b37e214f092b2a6d53072f6a89f2397dc069decc35031a4a18c55ce7fcd4690e20775
6
+ metadata.gz: 5fc041aa4d97dd1c19170ef17aa39ff141debd9a1c38d750862c77eda880cc643a5dea481bccaf8e82d96d8555d2ad027e7bf36c92fb5ef90b8c867fcc5eddfe
7
+ data.tar.gz: 9df46a9b2777fed4ee8b857a0313db47ce87b524ddbe3217547d1465650d8e3b3d95e95d9ff50ee1d8c25cec6f3b1025e261a97ecacf0f787189e311899b8591
data/CHANGELOG.md CHANGED
@@ -1,10 +1,38 @@
1
1
  # Release History: opentelemetry-instrumentation-sidekiq
2
2
 
3
+ ### v0.18.0 / 2021-05-21
4
+
5
+ * ADDED: Updated API depedency for 1.0.0.rc1
6
+ * TEST: update test for redis instrumentation refactor [#760](https://github.com/open-telemetry/opentelemetry-ruby/pull/760)
7
+ * BREAKING CHANGE: Remove optional parent_context from in_span
8
+
9
+ * FIXED: Remove optional parent_context from in_span
10
+ * FIXED: Instrument Redis more thoroughly by patching Client#process.
11
+
12
+ ### v0.17.0 / 2021-04-22
13
+
14
+ * ADDED: Accept config for sidekiq peer service attribute
15
+
16
+ ### v0.16.0 / 2021-03-17
17
+
18
+ * FIXED: Example scripts now reference local common lib
19
+ * DOCS: Replace Gitter with GitHub Discussions
20
+
21
+ ### v0.15.0 / 2021-02-18
22
+
23
+ * ADDED: Add instrumentation config validation
24
+
25
+ ### v0.14.0 / 2021-02-03
26
+
27
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
28
+
29
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
30
+
3
31
  ### v0.13.0 / 2021-01-29
4
32
 
5
- * ADDED: Instrument sidekiq background work
6
- * FIXED: Adjust Sidekiq middlewares to match semantic conventions
7
- * FIXED: Set minimum compatible version and use untraced helper
33
+ * ADDED: Instrument sidekiq background work
34
+ * FIXED: Adjust Sidekiq middlewares to match semantic conventions
35
+ * FIXED: Set minimum compatible version and use untraced helper
8
36
 
9
37
  ### v0.12.0 / 2020-12-24
10
38
 
@@ -12,7 +40,7 @@
12
40
 
13
41
  ### v0.11.0 / 2020-12-11
14
42
 
15
- * FIXED: Copyright comments to not reference year
43
+ * FIXED: Copyright comments to not reference year
16
44
 
17
45
  ### v0.10.0 / 2020-12-03
18
46
 
@@ -20,9 +48,9 @@
20
48
 
21
49
  ### v0.9.0 / 2020-11-27
22
50
 
23
- * BREAKING CHANGE: Add timeout for force_flush and shutdown
51
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
24
52
 
25
- * ADDED: Add timeout for force_flush and shutdown
53
+ * ADDED: Add timeout for force_flush and shutdown
26
54
 
27
55
  ### v0.8.0 / 2020-10-27
28
56
 
@@ -30,9 +58,9 @@
30
58
 
31
59
  ### v0.7.0 / 2020-10-07
32
60
 
33
- * DOCS: Adding README for Sidekiq instrumentation
34
- * DOCS: Remove duplicate reference in Sidekiq README
35
- * DOCS: Standardize toplevel docs structure and readme
61
+ * DOCS: Adding README for Sidekiq instrumentation
62
+ * DOCS: Remove duplicate reference in Sidekiq README
63
+ * DOCS: Standardize toplevel docs structure and readme
36
64
 
37
65
  ### v0.6.0 / 2020-09-10
38
66
 
data/README.md CHANGED
@@ -33,11 +33,20 @@ end
33
33
 
34
34
  Example usage can be seen in the `./example/sidekiq.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/sidekiq/example/sidekiq.rb)
35
35
 
36
- ## How can I get invovled?
36
+ ## Development
37
+
38
+ You'll need Redis installed locally to run the test suite. Once you've
39
+ installed it, it will start and stop automatically when you run `rake`.
40
+
41
+ ```
42
+ redis-server test/redis.conf
43
+ ```
44
+
45
+ ## How can I get involved?
37
46
 
38
47
  The `opentelemetry-instrumentation-sidekiq` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
39
48
 
40
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
49
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
41
50
 
42
51
  ## License
43
52
 
@@ -49,4 +58,4 @@ The `opentelemetry-instrumentation-sidekiq` gem is distributed under the Apache
49
58
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
50
59
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
51
60
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
52
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
61
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -5,6 +5,7 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  require 'opentelemetry'
8
+ require 'opentelemetry-instrumentation-base'
8
9
 
9
10
  module OpenTelemetry
10
11
  module Instrumentation
@@ -27,6 +27,13 @@ module OpenTelemetry
27
27
  gem_version >= MINIMUM_VERSION
28
28
  end
29
29
 
30
+ option :enable_job_class_span_names, default: false, validate: :boolean
31
+ option :trace_launcher_heartbeat, default: false, validate: :boolean
32
+ option :trace_poller_enqueue, default: false, validate: :boolean
33
+ option :trace_poller_wait, default: false, validate: :boolean
34
+ option :trace_processor_process_one, default: false, validate: :boolean
35
+ option :peer_service, default: nil, validate: :string
36
+
30
37
  private
31
38
 
32
39
  def gem_version
@@ -15,16 +15,10 @@ module OpenTelemetry
15
15
  def call(_worker_class, job, _queue, _redis_pool)
16
16
  tracer.in_span(
17
17
  span_name(job),
18
- attributes: {
19
- 'messaging.system' => 'sidekiq',
20
- 'messaging.sidekiq.job_class' => job['wrapped']&.to_s || job['class'],
21
- 'messaging.message_id' => job['jid'],
22
- 'messaging.destination' => job['queue'],
23
- 'messaging.destination_kind' => 'queue'
24
- },
18
+ attributes: build_attributes(job),
25
19
  kind: :producer
26
20
  ) do |span|
27
- OpenTelemetry.propagation.text.inject(job)
21
+ OpenTelemetry.propagation.inject(job)
28
22
  span.add_event('created_at', timestamp: job['created_at'])
29
23
  yield
30
24
  end
@@ -32,6 +26,18 @@ module OpenTelemetry
32
26
 
33
27
  private
34
28
 
29
+ def build_attributes(job)
30
+ attributes = {
31
+ 'messaging.system' => 'sidekiq',
32
+ 'messaging.sidekiq.job_class' => job['wrapped']&.to_s || job['class'],
33
+ 'messaging.message_id' => job['jid'],
34
+ 'messaging.destination' => job['queue'],
35
+ 'messaging.destination_kind' => 'queue'
36
+ }
37
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
38
+ attributes
39
+ end
40
+
35
41
  def span_name(job)
36
42
  if config[:enable_job_class_span_names]
37
43
  "#{job['wrapped']&.to_s || job['class']} enqueue"
@@ -13,27 +13,34 @@ module OpenTelemetry
13
13
  # by way of its middleware system
14
14
  class TracerMiddleware
15
15
  def call(_worker, msg, _queue)
16
- parent_context = OpenTelemetry.propagation.text.extract(msg)
17
- tracer.in_span(
18
- span_name(msg),
19
- attributes: {
20
- 'messaging.system' => 'sidekiq',
21
- 'messaging.sidekiq.job_class' => msg['wrapped']&.to_s || msg['class'],
22
- 'messaging.message_id' => msg['jid'],
23
- 'messaging.destination' => msg['queue'],
24
- 'messaging.destination_kind' => 'queue'
25
- },
26
- with_parent: parent_context,
27
- kind: :consumer
28
- ) do |span|
29
- span.add_event('created_at', timestamp: msg['created_at'])
30
- span.add_event('enqueued_at', timestamp: msg['enqueued_at'])
31
- yield
16
+ extracted_context = OpenTelemetry.propagation.extract(msg)
17
+ OpenTelemetry::Context.with_current(extracted_context) do
18
+ tracer.in_span(
19
+ span_name(msg),
20
+ attributes: build_attributes(msg),
21
+ kind: :consumer
22
+ ) do |span|
23
+ span.add_event('created_at', timestamp: msg['created_at'])
24
+ span.add_event('enqueued_at', timestamp: msg['enqueued_at'])
25
+ yield
26
+ end
32
27
  end
33
28
  end
34
29
 
35
30
  private
36
31
 
32
+ def build_attributes(msg)
33
+ attributes = {
34
+ 'messaging.system' => 'sidekiq',
35
+ 'messaging.sidekiq.job_class' => msg['wrapped']&.to_s || msg['class'],
36
+ 'messaging.message_id' => msg['jid'],
37
+ 'messaging.destination' => msg['queue'],
38
+ 'messaging.destination_kind' => 'queue'
39
+ }
40
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
41
+ attributes
42
+ end
43
+
37
44
  def span_name(msg)
38
45
  if config[:enable_job_class_span_names]
39
46
  "#{msg['wrapped']&.to_s || msg['class']} process"
@@ -14,7 +14,9 @@ module OpenTelemetry
14
14
 
15
15
  def ❤ # rubocop:disable Naming/MethodName
16
16
  if config[:trace_launcher_heartbeat]
17
- tracer.in_span('Sidekiq::Launcher#heartbeat') { super }
17
+ attributes = {}
18
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
19
+ tracer.in_span('Sidekiq::Launcher#heartbeat', attributes: attributes) { super }
18
20
  else
19
21
  OpenTelemetry::Common::Utilities.untraced { super }
20
22
  end
@@ -12,7 +12,9 @@ module OpenTelemetry
12
12
  module Poller
13
13
  def enqueue
14
14
  if config[:trace_poller_enqueue]
15
- tracer.in_span('Sidekiq::Scheduled::Poller#enqueue') { super }
15
+ attributes = {}
16
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
17
+ tracer.in_span('Sidekiq::Scheduled::Poller#enqueue', attributes: attributes) { super }
16
18
  else
17
19
  OpenTelemetry::Common::Utilities.untraced { super }
18
20
  end
@@ -8,13 +8,15 @@ module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Sidekiq
10
10
  module Patches
11
- # The Processor module contains the insturmentation for the process_one method
11
+ # The Processor module contains the instrumentation for the process_one method
12
12
  module Processor
13
13
  private
14
14
 
15
15
  def process_one
16
16
  if config[:trace_processor_process_one]
17
- tracer.in_span('Sidekiq::Processor#process_one') { super }
17
+ attributes = {}
18
+ attributes['peer.service'] = config[:peer_service] if config[:peer_service]
19
+ tracer.in_span('Sidekiq::Processor#process_one', attributes: attributes) { super }
18
20
  else
19
21
  OpenTelemetry::Common::Utilities.untraced { super }
20
22
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Sidekiq
10
- VERSION = '0.13.0'
10
+ VERSION = '0.18.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-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.18.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: 2021-01-30 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.13.0
19
+ version: 1.0.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.13.0
26
+ version: 1.0.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opentelemetry-common
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.13.0
33
+ version: 0.18.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.13.0
40
+ version: 0.18.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: opentelemetry-instrumentation-base
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.18.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.18.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: appraisal
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +100,14 @@ dependencies:
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '0.0'
103
+ version: 1.0.0.rc1
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '0.0'
110
+ version: 1.0.0.rc1
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rubocop
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -189,10 +203,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
189
203
  licenses:
190
204
  - Apache-2.0
191
205
  metadata:
192
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.13.0/file.CHANGELOG.html
206
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.18.0/file.CHANGELOG.html
193
207
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/sidekiq
194
208
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
195
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.13.0
209
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.18.0
196
210
  post_install_message:
197
211
  rdoc_options: []
198
212
  require_paths:
@@ -208,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
222
  - !ruby/object:Gem::Version
209
223
  version: '0'
210
224
  requirements: []
211
- rubygems_version: 3.1.4
225
+ rubygems_version: 3.1.6
212
226
  signing_key:
213
227
  specification_version: 4
214
228
  summary: Sidekiq instrumentation for the OpenTelemetry framework