signalfx-tracing 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -2
- data/lib/signalfx/tracing/instrumentation/active_record.rb +2 -1
- data/lib/signalfx/tracing/instrumentation/faraday.rb +2 -1
- data/lib/signalfx/tracing/instrumentation/mysql2.rb +2 -1
- data/lib/signalfx/tracing/instrumentation/net_http.rb +2 -1
- data/lib/signalfx/tracing/instrumentation/rails.rb +4 -0
- data/lib/signalfx/tracing/instrumentation/restclient.rb +2 -1
- data/lib/signalfx/tracing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe697abb23f55c936cd5937309410b186258073
|
4
|
+
data.tar.gz: 7d32357ae60676f74828bf95fa7294b67880a039
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 >=
|
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
|
@@ -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
|