opentelemetry-instrumentation-sidekiq 0.5.0 → 0.10.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: 1a4372caa4ce93660a0272de62ff47b1fd0f897b10e34b4c4713e86886dcb661
4
- data.tar.gz: 454e13a799f4bcc980cc2cfc2f7d07380bec8be88005a2c09e1a109e95269874
3
+ metadata.gz: f1348a87123eadcb378d285875b8aa056d1504ba7570119fc0198798d0eab42d
4
+ data.tar.gz: 389b4b4c843538e106383f75c9eb82e17bc60b74952f5fdd9a6e39d3fa57e6f6
5
5
  SHA512:
6
- metadata.gz: '08ca6e4746b64d3db1fe66a007427c2c79e95babfb38000365e4d1e76572979f7bab14775e1b53e59d49c41a577194454a98e08fe1aa4a33f359c6e99901a7d7'
7
- data.tar.gz: acd6f8ec2c30bc02adb91e85c6ce5ea211c74e8f7ea6405e2ca98d384e4438ddc8b0144a350676a17ef91678d0fa92b5d6239de8611c6207452df24d0eb8622d
6
+ metadata.gz: 52f9e6cb70e5702f000af558efef43e3ad7389e5ccdb2b9c77b61cc5ca6b2d92588dedabc882dd90360f319ea93fddf3d3f53f9b4d062fe7aa3ccb1da2dd096b
7
+ data.tar.gz: a305271c481c84204b0adce8eb062ba0db0f8ade6204560fe2dd95c6652bbc12609319afd7906a9721d5f54930964939eb85dc9a7182ffaf42d629775cfa153a
@@ -0,0 +1,9 @@
1
+ --no-private
2
+ --title=OpenTelemetry Sidekiq Instrumentation
3
+ --markup=markdown
4
+ --main=README.md
5
+ ./lib/opentelemetry/instrumentation/**/*.rb
6
+ ./lib/opentelemetry/instrumentation.rb
7
+ -
8
+ README.md
9
+ CHANGELOG.md
@@ -0,0 +1,25 @@
1
+ # Release History: opentelemetry-instrumentation-sidekiq
2
+
3
+ ### v0.10.0 / 2020-12-03
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.9.0 / 2020-11-27
8
+
9
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
10
+
11
+ * ADDED: Add timeout for force_flush and shutdown
12
+
13
+ ### v0.8.0 / 2020-10-27
14
+
15
+ * (No significant changes)
16
+
17
+ ### v0.7.0 / 2020-10-07
18
+
19
+ * DOCS: Adding README for Sidekiq instrumentation
20
+ * DOCS: Remove duplicate reference in Sidekiq README
21
+ * DOCS: Standardize toplevel docs structure and readme
22
+
23
+ ### v0.6.0 / 2020-09-10
24
+
25
+ * (No significant changes)
@@ -0,0 +1,52 @@
1
+ # OpenTelemetry Sidekiq Instrumentation
2
+
3
+ The Sidekiq instrumentation is a community-maintained instrumentation for the [Sidekiq][sidekiq-home] Ruby jobs system.
4
+
5
+ ## How do I get started?
6
+
7
+ Install the gem using:
8
+
9
+ ```
10
+ gem install opentelemetry-instrumentation-sidekiq
11
+ ```
12
+
13
+ Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-sidekiq` in your `Gemfile`.
14
+
15
+ ## Usage
16
+
17
+ To use the instrumentation, call `use` with the name of the instrumentation:
18
+
19
+ ```ruby
20
+ OpenTelemetry::SDK.configure do |c|
21
+ c.use 'OpenTelemetry::Instrumentation::Sidekiq'
22
+ end
23
+ ```
24
+
25
+ Alternatively, you can also call `use_all` to install all the available instrumentation.
26
+
27
+ ```ruby
28
+ OpenTelemetry::SDK.configure do |c|
29
+ c.use_all
30
+ end
31
+ ```
32
+ ## Examples
33
+
34
+ Example usage can be seen in the `./example/sidekiq.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/master/instrumentation/sidekiq/example/sidekiq.rb)
35
+
36
+ ## How can I get invovled?
37
+
38
+ The `opentelemetry-instrumentation-sidekiq` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
39
+
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].
41
+
42
+ ## License
43
+
44
+ The `opentelemetry-instrumentation-sidekiq` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
45
+
46
+ [sidekiq-home]: https://github.com/mperham/sidekiq
47
+ [bundler-home]: https://bundler.io
48
+ [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
49
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
50
+ [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
51
+ [community-meetings]: https://github.com/open-telemetry/community#community-meetings
52
+ [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -4,6 +4,12 @@
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
+ # OpenTelemetry is an open source observability framework, providing a
8
+ # general-purpose API, SDK, and related tools required for the instrumentation
9
+ # of cloud-native software, frameworks, and libraries.
10
+ #
11
+ # The OpenTelemetry module provides global accessors for telemetry objects.
12
+ # See the documentation for the `opentelemetry-api` gem for details.
7
13
  module OpenTelemetry
8
14
  # "Instrumentation" are specified by
9
15
  # https://github.com/open-telemetry/opentelemetry-specification/blob/784635d01d8690c8f5fcd1f55bdbc8a13cf2f4f2/specification/glossary.md#instrumentation-library
@@ -45,7 +45,7 @@ module OpenTelemetry
45
45
  end
46
46
  end
47
47
 
48
- if defined?(::Sidekiq::Testing)
48
+ if defined?(::Sidekiq::Testing) # rubocop:disable Style/GuardClause
49
49
  ::Sidekiq::Testing.server_middleware do |chain|
50
50
  chain.add Middlewares::Server::TracerMiddleware
51
51
  end
@@ -9,18 +9,20 @@ module OpenTelemetry
9
9
  module Sidekiq
10
10
  module Middlewares
11
11
  module Client
12
+ # TracerMiddleware propagates context and instruments Sidekiq client
13
+ # by way of its middleware system
12
14
  class TracerMiddleware
13
15
  def call(_worker_class, job, _queue, _redis_pool)
14
16
  tracer.in_span(
15
17
  job['wrapped']&.to_s || job['class'],
16
18
  attributes: {
17
19
  'messaging.message_id' => job['jid'],
18
- 'messaging.destination' => job['queue'],
20
+ 'messaging.destination' => job['queue']
19
21
  },
20
22
  kind: :producer
21
23
  ) do |span|
22
24
  OpenTelemetry.propagation.text.inject(job)
23
- span.add_event(name: 'created_at', timestamp: job['created_at'])
25
+ span.add_event('created_at', timestamp: job['created_at'])
24
26
  yield
25
27
  end
26
28
  end
@@ -9,6 +9,8 @@ module OpenTelemetry
9
9
  module Sidekiq
10
10
  module Middlewares
11
11
  module Server
12
+ # TracerMiddleware propagates context and instruments Sidekiq requests
13
+ # by way of its middleware system
12
14
  class TracerMiddleware
13
15
  def call(_worker, msg, _queue)
14
16
  parent_context = OpenTelemetry.propagation.text.extract(msg)
@@ -16,13 +18,13 @@ module OpenTelemetry
16
18
  msg['wrapped']&.to_s || msg['class'],
17
19
  attributes: {
18
20
  'messaging.message_id' => msg['jid'],
19
- 'messaging.destination' => msg['queue'],
21
+ 'messaging.destination' => msg['queue']
20
22
  },
21
- with_parent_context: parent_context,
23
+ with_parent: parent_context,
22
24
  kind: :consumer
23
25
  ) do |span|
24
- span.add_event(name: 'created_at', timestamp: msg['created_at'])
25
- span.add_event(name: 'enqueued_at', timestamp: msg['enqueued_at'])
26
+ span.add_event('created_at', timestamp: msg['created_at'])
27
+ span.add_event('enqueued_at', timestamp: msg['enqueued_at'])
26
28
  yield
27
29
  end
28
30
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Sidekiq
10
- VERSION = '0.5.0'
10
+ VERSION = '0.10.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.5.0
4
+ version: 0.10.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: 2020-07-17 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.0'
19
+ version: 0.10.0
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.0'
26
+ version: 0.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -157,7 +157,10 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
+ - ".yardopts"
161
+ - CHANGELOG.md
160
162
  - LICENSE
163
+ - README.md
161
164
  - lib/opentelemetry-instrumentation-sidekiq.rb
162
165
  - lib/opentelemetry/instrumentation.rb
163
166
  - lib/opentelemetry/instrumentation/sidekiq.rb
@@ -168,7 +171,11 @@ files:
168
171
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
169
172
  licenses:
170
173
  - Apache-2.0
171
- metadata: {}
174
+ metadata:
175
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.10.0/file.CHANGELOG.html
176
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/sidekiq
177
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
178
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-sidekiq/v0.10.0
172
179
  post_install_message:
173
180
  rdoc_options: []
174
181
  require_paths:
@@ -184,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
191
  - !ruby/object:Gem::Version
185
192
  version: '0'
186
193
  requirements: []
187
- rubygems_version: 3.0.3
194
+ rubygems_version: 3.1.4
188
195
  signing_key:
189
196
  specification_version: 4
190
197
  summary: Sidekiq instrumentation for the OpenTelemetry framework