signalfx-tracing 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 1c6ff836a9a573045e3aac0ea378a834f286b98f
4
- data.tar.gz: 6f195c1c6bfc7bb9ae83b7c554af22b2451e7532
3
+ metadata.gz: fbe697abb23f55c936cd5937309410b186258073
4
+ data.tar.gz: 7d32357ae60676f74828bf95fa7294b67880a039
5
5
  SHA512:
6
- metadata.gz: e7c2c8fe68cc903d5a3d378d30810fcb14ed1eed352261d80081f07c1534609cdf789698cfff2b78b5fd34699aaaaa8c2ea18681a85915a3dc44083a4153fba6
7
- data.tar.gz: 6e3fa6cdbbf10bc991a7b3b7039536c6af3681806e5ae6172c9afa2b0359515e58f7deb4c45930f9b6188df6b0224486d2aca18537ca3ea6445e9f12eb07c57f
6
+ metadata.gz: 3e40fc35b33a468d4fcc501a1d3e00b76645bff8389960cf7b61b26a7d51a53fefc1dacb1f32a5facbbe6992ba1de08e64b32765d97b57e7ec7ae963eb5c61a8
7
+ data.tar.gz: 7682f03f50444badb12acd4039405ef9ccd6c6675f7fd3de3885ddc850793a513d9caea75c846d755f01f01881ea69c9bdc37e58d4eb53e4fc4f716804096f9f
data/README.md CHANGED
@@ -77,7 +77,7 @@ This section contains details and configuration for specific frameworks.
77
77
 
78
78
  ### Web servers
79
79
 
80
- - Puma >= 5.0.0
80
+ - Puma >= 3.0.0
81
81
 
82
82
  ### Libraries/Frameworks
83
83
 
@@ -167,6 +167,20 @@ end
167
167
 
168
168
  For more detailed usage, please check the instrumentation's page.
169
169
 
170
+ ## Mongo
171
+
172
+ Mongo driver instrumentation traces queries performed through the Ruby Mongodb driver.
173
+
174
+ The source for this instrumentation is located [here](https://github.com/signalfx/ruby-mongodb-instrumentation)
175
+
176
+ ### Usage
177
+
178
+ ```ruby
179
+ SignalFx::Tracing::Instrumenter.configure do |p|
180
+ p.instrument(:MongoDB)
181
+ end
182
+ ```
183
+
170
184
  ## Mysql2
171
185
 
172
186
  Mysql2 instrumentation traces all queries performed with the Mysql2 client.
@@ -191,10 +205,12 @@ The source for this instrumentation is located [here](https://github.com/signalf
191
205
 
192
206
  ```ruby
193
207
  SignalFx::Tracing::Instrumenter.configure do |p|
194
- p.instrument(:NetHttp)
208
+ p.instrument(:NetHttp, tracer: tracer)
195
209
  end
196
210
  ```
197
211
 
212
+ An optional `tracer` named argument can be provided to use a custom tracer. It will default to `OpenTracing.global_tracer` if not provided.
213
+
198
214
  ## Rack
199
215
 
200
216
  Rack spans are created using the `rack-tracer` gem. This is enabled
@@ -235,6 +251,10 @@ SignalFx::Tracing::Instrumenter.configure do |p|
235
251
  end
236
252
  ```
237
253
 
254
+ Note that if `rack_tracer` is set to `false`, requests propagated to the Rails
255
+ app will not be extracted. For example, if a traced service makes a request to
256
+ an endpoint served by the Rails app, it will not be automatically nested.
257
+
238
258
  ## RestClient
239
259
 
240
260
  RestClient requests can be patched to automatically be wrapped in a span. It
@@ -17,7 +17,8 @@ module SignalFx
17
17
  end
18
18
 
19
19
  require 'active_record/opentracing'
20
- ::ActiveRecord::OpenTracing.instrument
20
+ ::ActiveRecord::OpenTracing.instrument if !@instrumented
21
+ @instrumented = true
21
22
  end
22
23
  end
23
24
  end
@@ -16,7 +16,8 @@ module SignalFx
16
16
 
17
17
  require 'faraday/tracer'
18
18
 
19
- patch_initialize
19
+ patch_initialize if !@instrumented
20
+ @instrumented = true
20
21
  end
21
22
 
22
23
  # somewhat messy, but this lets connections be traced without manual
@@ -16,7 +16,8 @@ module SignalFx
16
16
 
17
17
  require 'mysql2/instrumentation'
18
18
 
19
- ::Mysql2::Instrumentation.instrument(tracer: SignalFx::Tracing::Instrumenter.tracer)
19
+ ::Mysql2::Instrumentation.instrument(tracer: SignalFx::Tracing::Instrumenter.tracer) if !@instrumented
20
+ @instrumented = true
20
21
  end
21
22
  end
22
23
  end
@@ -12,7 +12,8 @@ module SignalFx
12
12
 
13
13
  tracer = opts.fetch(:tracer, OpenTracing.global_tracer)
14
14
  ignore_request = lambda { Thread.current.thread_variable_get(:http_sender_thread) }
15
- ::Net::Http::Instrumentation.instrument(tracer: tracer, ignore_request: ignore_request)
15
+ ::Net::Http::Instrumentation.instrument(tracer: tracer, ignore_request: ignore_request) if !@instrumented
16
+ @instrumented = true
16
17
  end
17
18
  end
18
19
  end
@@ -8,6 +8,8 @@ module SignalFx
8
8
  class << self
9
9
 
10
10
  def instrument(opts = {})
11
+ return if @instrumented
12
+
11
13
  # instrument supported versions
12
14
  return if !defined?(::Rails) or Gem::Version.new(::Rails::VERSION::STRING) < Gem::Version.new('3.2')
13
15
 
@@ -21,6 +23,8 @@ module SignalFx
21
23
  end
22
24
 
23
25
  ::Rails::Tracer.instrument(full_trace: true)
26
+
27
+ @instrumented = true
24
28
  end
25
29
  end
26
30
  end
@@ -18,7 +18,8 @@ module SignalFx
18
18
 
19
19
  tracer = opts.fetch(:tracer, OpenTracing.global_tracer)
20
20
  propagate = opts.fetch(:propagate, false)
21
- ::RestClient::Instrumentation.instrument(tracer: tracer, propagate: propagate)
21
+ ::RestClient::Instrumentation.instrument(tracer: tracer, propagate: propagate) if !@instrumented
22
+ @instrumented = true
22
23
  end
23
24
  end
24
25
  end
@@ -1,5 +1,5 @@
1
1
  module Signalfx
2
2
  module Tracing
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signalfx-tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ashwin Chandrasekar