zipkin-tracer 0.18.0 → 0.18.1
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 +8 -8
- data/lib/zipkin-tracer/faraday/zipkin-tracer.rb +12 -9
- data/lib/zipkin-tracer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjBjZDM0NTg0MGY1Y2Q1Mzg1NjBiMDEzMGNiMDgyZTI5ZjkxYmVmNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzhlN2Y3MGFlMWViZDlhMzI0ZjM4MTY4ODAyNjY2NjZkY2NlMjgxZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDA2NmMxNjVjOGIzOTY3ZGQxNTVlNWU2NzQwOWMzYjkzOTJhYWFjM2IwMWVi
|
10
|
+
YjUxYWNkNmFiNjcwODcwYTk1MTEyYTJhODk1ZDdjZWM1NTY4M2QzNTQ5MmY5
|
11
|
+
ODgyOGUwMjZiMjliNDNkYTAwNjQzODk2MGMzNzgyZDRlZmZlZmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGRkNTI5ZmM0Njg3YTc2NmIzY2ViNWM2MDRjMDI0MDJkYmEwZjcyZGNhN2Nj
|
14
|
+
NmI2MzE5OWExMDA5ZmZkZDQ0MDA3OTgwMWFiYTlhZjM4ZDYzZGU3Y2I1NzQ5
|
15
|
+
ZjlkMjFlNWRhY2MyMzg3ZmQ0NmU4NDJlNmQ3MTVlM2Q5MTgzZTE=
|
@@ -6,14 +6,6 @@ require 'uri'
|
|
6
6
|
module ZipkinTracer
|
7
7
|
# Faraday middleware. It will add CR/CS annotations to outgoing connections done by Faraday
|
8
8
|
class FaradayHandler < ::Faraday::Middleware
|
9
|
-
B3_HEADERS = {
|
10
|
-
trace_id: 'X-B3-TraceId',
|
11
|
-
parent_id: 'X-B3-ParentSpanId',
|
12
|
-
span_id: 'X-B3-SpanId',
|
13
|
-
sampled: 'X-B3-Sampled',
|
14
|
-
flags: 'X-B3-Flags'
|
15
|
-
}.freeze
|
16
|
-
|
17
9
|
def initialize(app, service_name = nil)
|
18
10
|
@app = app
|
19
11
|
@service_name = service_name
|
@@ -22,7 +14,7 @@ module ZipkinTracer
|
|
22
14
|
def call(env)
|
23
15
|
trace_id = Trace.id.next_id
|
24
16
|
Trace.with_trace_id(trace_id) do
|
25
|
-
|
17
|
+
b3_headers.each do |method, header|
|
26
18
|
env[:request_headers][header] = trace_id.send(method).to_s
|
27
19
|
end
|
28
20
|
if trace_id.sampled?
|
@@ -34,8 +26,19 @@ module ZipkinTracer
|
|
34
26
|
end
|
35
27
|
|
36
28
|
private
|
29
|
+
|
37
30
|
SERVER_ADDRESS_SPECIAL_VALUE = '1'.freeze
|
38
31
|
|
32
|
+
def b3_headers
|
33
|
+
{
|
34
|
+
trace_id: 'X-B3-TraceId',
|
35
|
+
parent_id: 'X-B3-ParentSpanId',
|
36
|
+
span_id: 'X-B3-SpanId',
|
37
|
+
sampled: 'X-B3-Sampled',
|
38
|
+
flags: 'X-B3-Flags'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
39
42
|
def trace!(env, trace_id)
|
40
43
|
response = nil
|
41
44
|
# handle either a URI object (passed by Faraday v0.8.x in testing), or something string-izable
|
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.18.
|
4
|
+
version: 0.18.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: 2016-05-
|
16
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: faraday
|