jaeger-client 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jaeger-client.gemspec +1 -1
- data/lib/jaeger/client/collector.rb +2 -2
- data/lib/jaeger/client/span_context.rb +12 -1
- data/lib/jaeger/client/tracer.rb +14 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0a5e297b04058c0148a9e388c5741be1e9006c2
|
4
|
+
data.tar.gz: b6b8f39f0cd210ffc86807a25f4274e06ab3d614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e1090dd6ef3b06b3cbaba4c64040d81fe6fc7afbd2d028927c49a06c52e90641765110c5cad8365fef2db974d633d95e59deb79fc09e27dc24877103900f42
|
7
|
+
data.tar.gz: 20e878c8547684a4d6f0bd1717e7f042f106ad94d4b12cda0ebef7016193e747941796cd5ae42f25263b4ed6429ee2fb5258ee1d9360448bb3f491d97edbd2c6
|
data/jaeger-client.gemspec
CHANGED
@@ -13,9 +13,9 @@ module Jaeger
|
|
13
13
|
|
14
14
|
@buffer << Jaeger::Thrift::Span.new(
|
15
15
|
'traceIdLow' => context.trace_id,
|
16
|
-
'traceIdHigh' =>
|
16
|
+
'traceIdHigh' => 0,
|
17
17
|
'spanId' => context.span_id,
|
18
|
-
'parentSpanId' => context.parent_id
|
18
|
+
'parentSpanId' => context.parent_id,
|
19
19
|
'operationName' => span.operation_name,
|
20
20
|
'references' => [],
|
21
21
|
'flags' => context.flags,
|
@@ -17,13 +17,24 @@ module Jaeger
|
|
17
17
|
|
18
18
|
attr_reader :span_id, :parent_id, :trace_id, :baggage, :flags
|
19
19
|
|
20
|
-
def initialize(span_id:, parent_id:
|
20
|
+
def initialize(span_id:, parent_id: 0, trace_id:, baggage: {})
|
21
21
|
@span_id = span_id
|
22
22
|
@parent_id = parent_id
|
23
23
|
@trace_id = trace_id
|
24
24
|
@baggage = baggage
|
25
25
|
@flags = 0
|
26
26
|
end
|
27
|
+
|
28
|
+
def inspect
|
29
|
+
to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_s
|
33
|
+
"#<SpanContext @span_id=#{span_id.to_s(16)} " +
|
34
|
+
"@parent_id=#{parent_id.to_s(16)} " +
|
35
|
+
"@trace_id=#{trace_id.to_s(16)} " +
|
36
|
+
"@flags=#{flags}>"
|
37
|
+
end
|
27
38
|
end
|
28
39
|
end
|
29
40
|
end
|
data/lib/jaeger/client/tracer.rb
CHANGED
@@ -40,10 +40,10 @@ module Jaeger
|
|
40
40
|
case format
|
41
41
|
when OpenTracing::FORMAT_TEXT_MAP, OpenTracing::FORMAT_RACK
|
42
42
|
carrier['uber-trace-id'] = [
|
43
|
-
span_context.trace_id,
|
44
|
-
span_context.span_id,
|
45
|
-
span_context.parent_id
|
46
|
-
span_context.flags
|
43
|
+
span_context.trace_id.to_s(16),
|
44
|
+
span_context.span_id.to_s(16),
|
45
|
+
span_context.parent_id.to_s(16),
|
46
|
+
span_context.flags.to_s(16)
|
47
47
|
].join(':')
|
48
48
|
else
|
49
49
|
warn "Jaeger::Client with format #{format} is not supported yet"
|
@@ -71,13 +71,18 @@ module Jaeger
|
|
71
71
|
|
72
72
|
def parse_context(trace)
|
73
73
|
return nil if !trace || trace == ''
|
74
|
-
trace_id, span_id, parent_id, _flags = trace.split(':')
|
75
74
|
|
76
|
-
|
77
|
-
|
75
|
+
trace_arguments = trace.split(':').map {|arg| arg.to_i(16)}
|
76
|
+
return nil if trace_arguments.size != 4
|
78
77
|
|
79
|
-
|
80
|
-
|
78
|
+
trace_id, span_id, parent_id, _flags = trace_arguments
|
79
|
+
|
80
|
+
if trace_id != 0 && span_id != 0
|
81
|
+
SpanContext.new(
|
82
|
+
trace_id: trace_id,
|
83
|
+
parent_id: parent_id,
|
84
|
+
span_id: span_id
|
85
|
+
)
|
81
86
|
else
|
82
87
|
nil
|
83
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jaeger-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SaleMove TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|