zipkin-tracer 0.36.0 → 0.36.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zipkin-tracer/version.rb +1 -1
- data/lib/zipkin-tracer/zipkin_http_sender.rb +19 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9731d7b33a04a21d40dbb5e887bc9f54d3052822b9a940b4c67abd9d263802ee
|
4
|
+
data.tar.gz: 914938b89e93da3977a7df4eea19d5ec5e4c626410776c2fb69c25ec853a9c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de1f610c691567ed0f31bfe1d71625082c0b8a73b2fd78294770b566d24d39b49af45fab24b440947a3ae9f869ae6d25f97165c790f3a7170b414d4c94f5d820
|
7
|
+
data.tar.gz: 74f20c4a09682e3049194e3d1d897f2977d6a00b08f2ffc98707c8d9e1dff76918892ea9726a0fe938670aa642ea01b7f03073ac9fe2efa0b78148ddbcc4c1ba
|
@@ -3,28 +3,29 @@ require 'sucker_punch'
|
|
3
3
|
require 'zipkin-tracer/zipkin_sender_base'
|
4
4
|
require 'zipkin-tracer/hostname_resolver'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
module Trace
|
7
|
+
class AsyncHttpApiClient
|
8
|
+
include SuckerPunch::Job
|
9
|
+
SPANS_PATH = '/api/v2/spans'
|
10
|
+
|
11
|
+
def perform(json_api_host, spans)
|
12
|
+
spans_with_ips =
|
13
|
+
::ZipkinTracer::HostnameResolver.new.spans_with_ips(spans, ZipkinHttpSender::IP_FORMAT).map(&:to_h)
|
9
14
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
resp = Faraday.new(json_api_host).post do |req|
|
16
|
+
req.url SPANS_PATH
|
17
|
+
req.headers['Content-Type'] = 'application/json'
|
18
|
+
req.body = JSON.generate(spans_with_ips)
|
19
|
+
end
|
20
|
+
rescue Net::ReadTimeout, Faraday::ConnectionFailed => e
|
21
|
+
error_message = "Error while connecting to #{json_api_host}: #{e.class.inspect} with message '#{e.message}'. " \
|
22
|
+
"Please make sure the URL / port are properly specified for the Zipkin server."
|
23
|
+
SuckerPunch.logger.error(error_message)
|
24
|
+
rescue => e
|
25
|
+
SuckerPunch.logger.error(e)
|
17
26
|
end
|
18
|
-
rescue Net::ReadTimeout, Faraday::ConnectionFailed => e
|
19
|
-
error_message = "Error while connecting to #{json_api_host}: #{e.class.inspect} with message '#{e.message}'. " \
|
20
|
-
"Please make sure the URL / port are properly specified for the Zipkin server."
|
21
|
-
SuckerPunch.logger.error(error_message)
|
22
|
-
rescue => e
|
23
|
-
SuckerPunch.logger.error(e)
|
24
27
|
end
|
25
|
-
end
|
26
28
|
|
27
|
-
module Trace
|
28
29
|
# This class sends information to the Zipkin API.
|
29
30
|
# The API accepts a JSON representation of a list of spans
|
30
31
|
class ZipkinHttpSender < ZipkinSenderBase
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipkin-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.36.
|
4
|
+
version: 0.36.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Hu
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2019-04-
|
16
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: faraday
|