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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc47584b45bef088c9871ca1a40a73ebbc04bad8
4
- data.tar.gz: '03990b88b5c512ef7278be81980e1ba8e23b9b8d'
3
+ metadata.gz: a0a5e297b04058c0148a9e388c5741be1e9006c2
4
+ data.tar.gz: b6b8f39f0cd210ffc86807a25f4274e06ab3d614
5
5
  SHA512:
6
- metadata.gz: 8c8b9cd13c3fd71a6b83ce793ae55d4ddfc59e0169c2c1f0ef75390df37eedd4fc5f9c34c24654d2f4c2bd86e13aee6f4eca3c043f0ad6b17bbca898a771c3bd
7
- data.tar.gz: 26098a8331acd51cbbcf345ae510158cd96ab4e37c55857cf5db4b327bef6634eba46f7ae35b59a03e45e34093b16db0692c1d0698d5d2da32189e981c04d51f
6
+ metadata.gz: 68e1090dd6ef3b06b3cbaba4c64040d81fe6fc7afbd2d028927c49a06c52e90641765110c5cad8365fef2db974d633d95e59deb79fc09e27dc24877103900f42
7
+ data.tar.gz: 20e878c8547684a4d6f0bd1717e7f042f106ad94d4b12cda0ebef7016193e747941796cd5ae42f25263b4ed6429ee2fb5258ee1d9360448bb3f491d97edbd2c6
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'jaeger-client'
7
- spec.version = '0.2.0'
7
+ spec.version = '0.3.0'
8
8
  spec.authors = ['SaleMove TechMovers']
9
9
  spec.email = ['techmovers@salemove.com']
10
10
 
@@ -13,9 +13,9 @@ module Jaeger
13
13
 
14
14
  @buffer << Jaeger::Thrift::Span.new(
15
15
  'traceIdLow' => context.trace_id,
16
- 'traceIdHigh' => context.trace_id,
16
+ 'traceIdHigh' => 0,
17
17
  'spanId' => context.span_id,
18
- 'parentSpanId' => context.parent_id || 0,
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: nil, trace_id:, baggage: {})
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
@@ -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 || 0,
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
- parent_id = parent_id
77
- parent_id = nil if parent_id == ''
75
+ trace_arguments = trace.split(':').map {|arg| arg.to_i(16)}
76
+ return nil if trace_arguments.size != 4
78
77
 
79
- if trace_id != '' && span_id != ''
80
- SpanContext.new(trace_id: trace_id, parent_id: parent_id, span_id: span_id)
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.2.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-05 00:00:00.000000000 Z
11
+ date: 2017-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler