signalfx-tracing 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -140,6 +140,7 @@ When interfacing with these web servers as a Rack application, please configure
140
140
  | [Redis](#redis) | >= 4.0.0 |
141
141
  | [RestClient](#restclient) | >= 1.5.0 |
142
142
  | [Sequel](#sequel) | >= 3.47.0 |
143
+ | [Sidekiq](#sidekiq) | >= 0.7.0 |
143
144
  | [Sinatra](#sinatra) | >= 1.0.0 |
144
145
 
145
146
  ## Active Record
@@ -460,6 +461,35 @@ Arguments:
460
461
  - `tracer`: Optional custom tracer for this instrumentation
461
462
  - Default: `OpenTracing.global_tracer`
462
463
 
464
+ ## Sidekiq
465
+
466
+ Sidekiq instrumentation traces worker job submissions and execution via [Sidekiq middleware](https://github.com/mperham/sidekiq/wiki/Middleware).
467
+ The instrumenter registers both client and server middleware that use job metadata to
468
+ represent all job submissions and their invocations. Trace context propagation adds
469
+ to this job metadata to unifiy distributed client and server requests and processing.
470
+
471
+ The source for this instrumentation is located [here](https://github.com/signalfx/ruby-sidekiq-tracer).
472
+
473
+ ### Usage
474
+
475
+ ```bash
476
+ $ # install the instrumentation if not done previously
477
+ $ sfx-rb-trace-bootstrap -i sidekiq
478
+ ```
479
+
480
+ ```ruby
481
+ SignalFx::Tracing::Instrumenter.configure do |p|
482
+ p.instrument(:Sidekiq, propagate: false)
483
+ end
484
+ ```
485
+
486
+ Arguments:
487
+ - `tracer`: Optional custom tracer for this instrumentation
488
+ - Default: `OpenTracing.global_tracer`
489
+ - `propagate`: Optional boolean to enable/disable trace context injection via job metadata
490
+ - Default: `true`
491
+
492
+
463
493
  ## Sinatra
464
494
 
465
495
  Sinatra instrumentation traces requests and template rendering. The instrumenter
@@ -16,6 +16,7 @@ instrumentations = {
16
16
  "redis" => ["redis-instrumentation", "~> 0.1.1"],
17
17
  "restclient" => ["restclient-instrumentation", "~> 0.1.1"],
18
18
  "sequel" => ["sequel-instrumentation", "~> 0.1.0"],
19
+ "sidekiq" => ["sfx-sidekiq-opentracing", "~> 0.0.3"],
19
20
  "sinatra" => ["sinatra-instrumentation", "~> 0.1.2"]
20
21
  }
21
22
 
@@ -9,6 +9,7 @@ group :instrumentations do
9
9
  gem 'redis-instrumentation', '~> 0.1.1'
10
10
  gem 'restclient-instrumentation', '~> 0.1.1'
11
11
  gem 'sequel-instrumentation', '~> 0.1.0'
12
+ gem 'sfx-sidekiq-opentracing', '~> 0.0.3'
12
13
  gem 'signalfx-elasticsearch-instrumentation', '~> 0.1.0'
13
14
  gem 'signalfx-faraday-instrumentation', '~> 0.1.1'
14
15
  gem 'sinatra-instrumentation', '~> 0.1.2'
@@ -21,7 +21,7 @@ module SignalFx
21
21
  @ingest_url = ingest_url
22
22
  @service_name = service_name
23
23
  @access_token = access_token
24
- set_tracer(tracer: tracer, service_name: service_name, access_token: access_token)
24
+ set_tracer(tracer: tracer, service_name: service_name, access_token: access_token) if @tracer.nil?
25
25
 
26
26
  if auto_instrument
27
27
  Register.available_libs.each_pair do |key, value|
@@ -55,10 +55,12 @@ module SignalFx
55
55
  @reporter = Jaeger::Client::Reporters::RemoteReporter.new(sender: @http_sender, flush_interval: 1)
56
56
 
57
57
  injectors = {
58
- OpenTracing::FORMAT_RACK => [Jaeger::Client::Injectors::B3RackCodec]
58
+ OpenTracing::FORMAT_RACK => [Jaeger::Client::Injectors::B3RackCodec],
59
+ OpenTracing::FORMAT_TEXT_MAP => [Jaeger::Client::Injectors::B3RackCodec]
59
60
  }
60
61
  extractors = {
61
- OpenTracing::FORMAT_RACK => [Jaeger::Client::Extractors::B3RackCodec]
62
+ OpenTracing::FORMAT_RACK => [Jaeger::Client::Extractors::B3RackCodec],
63
+ OpenTracing::FORMAT_TEXT_MAP => [Jaeger::Client::Extractors::B3TextMapCodec]
62
64
  }
63
65
 
64
66
  @tracer = Jaeger::Client.build(
@@ -0,0 +1,35 @@
1
+ module SignalFx
2
+ module Tracing
3
+ module Instrumenter
4
+ module Sidekiq
5
+
6
+ Register.add_lib :Sidekiq, self
7
+
8
+ class << self
9
+ def instrument(opts = {})
10
+ return if @instrumented
11
+ begin
12
+ require 'sidekiq'
13
+ rescue LoadError
14
+ return
15
+ end
16
+
17
+ begin
18
+ require 'sidekiq/tracer'
19
+ rescue LoadError => e
20
+ puts e.message
21
+ return
22
+ end
23
+
24
+ ::Sidekiq::Tracer.instrument(
25
+ tracer: opts.fetch(:tracer, OpenTracing.global_tracer),
26
+ opts: { propagate_context: opts.fetch(:propagate, true) }
27
+ )
28
+ @instrumented = true
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
@@ -42,3 +42,4 @@ require 'signalfx/tracing/instrumentation/mysql2'
42
42
  require 'signalfx/tracing/instrumentation/redis'
43
43
  require 'signalfx/tracing/instrumentation/sequel'
44
44
  require 'signalfx/tracing/instrumentation/grape'
45
+ require 'signalfx/tracing/instrumentation/sidekiq'
@@ -1,5 +1,5 @@
1
1
  module Signalfx
2
2
  module Tracing
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  # TODO pin versions once consistent across all dependencies
27
27
  spec.add_dependency "opentracing", "> 0.3.0"
28
- spec.add_dependency "jaeger-client", "~> 0.10.0"
28
+ spec.add_dependency "jaeger-client", "~> 1.0.0"
29
29
 
30
30
  # We are no longer setting all available instrumentations as dependencies.
31
31
  # Manual installation via bootstrapper or gem.deps.rb is now required.
metadata CHANGED
@@ -1,83 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signalfx-tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - SignalFx, Inc.
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2019-10-24 00:00:00.000000000 Z
12
+ date: 2019-11-20 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.16'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.16'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '10.0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '10.0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: opentracing
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - ">"
51
+ - - '>'
46
52
  - !ruby/object:Gem::Version
47
53
  version: 0.3.0
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - ">"
59
+ - - '>'
53
60
  - !ruby/object:Gem::Version
54
61
  version: 0.3.0
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: jaeger-client
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
- version: 0.10.0
69
+ version: 1.0.0
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
- version: 0.10.0
77
+ version: 1.0.0
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: nethttp-instrumentation
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - "~>"
83
+ - - ~>
74
84
  - !ruby/object:Gem::Version
75
85
  version: 0.1.2
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
93
  version: 0.1.2
83
94
  description:
@@ -88,7 +99,7 @@ executables:
88
99
  extensions: []
89
100
  extra_rdoc_files: []
90
101
  files:
91
- - ".gitignore"
102
+ - .gitignore
92
103
  - Gemfile
93
104
  - LICENSE
94
105
  - README.md
@@ -112,6 +123,7 @@ files:
112
123
  - lib/signalfx/tracing/instrumentation/redis.rb
113
124
  - lib/signalfx/tracing/instrumentation/restclient.rb
114
125
  - lib/signalfx/tracing/instrumentation/sequel.rb
126
+ - lib/signalfx/tracing/instrumentation/sidekiq.rb
115
127
  - lib/signalfx/tracing/instrumentation/sinatra.rb
116
128
  - lib/signalfx/tracing/register.rb
117
129
  - lib/signalfx/tracing/reporter/auto_reviving_async_reporter.rb
@@ -121,25 +133,26 @@ files:
121
133
  homepage: https://github.com/signalfx/signalfx-ruby-tracing
122
134
  licenses:
123
135
  - Apache-2.0
124
- metadata: {}
125
136
  post_install_message:
126
137
  rdoc_options: []
127
138
  require_paths:
128
139
  - lib
129
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
+ none: false
130
142
  requirements:
131
- - - ">="
143
+ - - '>='
132
144
  - !ruby/object:Gem::Version
133
145
  version: '0'
134
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
+ none: false
135
148
  requirements:
136
- - - ">="
149
+ - - '>='
137
150
  - !ruby/object:Gem::Version
138
151
  version: '0'
139
152
  requirements: []
140
153
  rubyforge_project:
141
- rubygems_version: 2.2.0
154
+ rubygems_version: 1.8.25
142
155
  signing_key:
143
- specification_version: 4
156
+ specification_version: 3
144
157
  summary: Auto-instrumentation framework for Ruby
145
158
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: ba2591d862b7c31748ce57e4011d1cf6e810811c
4
- data.tar.gz: 5bd3c7c1d10012b3593f2eb9e474a2c4cd583fb4
5
- SHA512:
6
- metadata.gz: 1270b6c9d02a08019277233f55f917a3257f05b559c5abaa31d0e10b1a8ea563caed502499a9642ec821d5d6cf33193a1e4cefb49c2c66035028a256660244ac
7
- data.tar.gz: d03c8427a2c07913a447b831a2386150fe637025ce4114bb7dc1b72ec7596c410b0c2ecda3fd41a6082a6c821e7d27fe5edc2d789ba0782fda2fb40c0e928a90