rails_opentracer 0.1.19 → 0.1.20
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90b20289f4fcdc5e0c033ee1101814ed215c76d0
|
4
|
+
data.tar.gz: a5b2d37497b67c1fbca82a7621fd7e410f62d74d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6035e3c289fe9ed57ffaf660f199f5a06e94728b1899b82b6d83b053a07c0f67dadbfaa6d1aca91591258ecadfdaddc47933a5c47b9330851d5336f05d39e5
|
7
|
+
data.tar.gz: c1de8a6d083d0c9a4d059203211b6c63b32a6a49f2391858db255997f33557c62976439e2a2000cdb0edd3de60cbe7220e3d4df74685c37f5cce92d9337602e0
|
@@ -1,6 +1,29 @@
|
|
1
1
|
require 'opentracing'
|
2
2
|
require 'zipkin'
|
3
3
|
|
4
|
+
class Zipkin::JsonClient
|
5
|
+
# temporary monkey patch for a HTTPS related issue,
|
6
|
+
# remove this once fix has been made to
|
7
|
+
def emit_batch(spans)
|
8
|
+
return if spans.empty?
|
9
|
+
|
10
|
+
http = Net::HTTP.new(@spans_uri.host, @spans_uri.port)
|
11
|
+
http.use_ssl = true if @spans_uri.scheme == 'https'
|
12
|
+
puts "@spans_uri: #{@spans_uri} request_uri #{@spans_uri.request_uri}"
|
13
|
+
request = Net::HTTP::Post.new(@spans_uri.request_uri, {
|
14
|
+
'Content-Type' => 'application/json'
|
15
|
+
})
|
16
|
+
request.body = JSON.dump(spans)
|
17
|
+
response = http.request(request)
|
18
|
+
|
19
|
+
if response.code != 202
|
20
|
+
STDERR.puts(response.body)
|
21
|
+
end
|
22
|
+
rescue => e
|
23
|
+
STDERR.puts("Error emitting spans batch: #{e.message}\n#{e.backtrace.join("\n")}")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
4
27
|
if ENV.key?('ZIPKIN_SERVICE_URL')
|
5
28
|
OpenTracing.global_tracer = Zipkin::Tracer.build(url: ENV['ZIPKIN_SERVICE_URL'], service_name: Rails.application.class.parent_name)
|
6
29
|
ActiveRecord::RailsOpentracer.instrument(tracer: OpenTracing.global_tracer, active_span: -> { $active_span })
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_opentracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Erasmus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|