jaeger-client 0.3.0 → 0.4.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: a0a5e297b04058c0148a9e388c5741be1e9006c2
4
- data.tar.gz: b6b8f39f0cd210ffc86807a25f4274e06ab3d614
3
+ metadata.gz: 82dd8d1de04e467f45bade61aecf422ee7ce5157
4
+ data.tar.gz: 60c024c46753bf95b8d8e1ce6ec4d36bb24d4a58
5
5
  SHA512:
6
- metadata.gz: 68e1090dd6ef3b06b3cbaba4c64040d81fe6fc7afbd2d028927c49a06c52e90641765110c5cad8365fef2db974d633d95e59deb79fc09e27dc24877103900f42
7
- data.tar.gz: 20e878c8547684a4d6f0bd1717e7f042f106ad94d4b12cda0ebef7016193e747941796cd5ae42f25263b4ed6429ee2fb5258ee1d9360448bb3f491d97edbd2c6
6
+ metadata.gz: f84be392b067291900e3f8a0f229641b61cf4c5a319c9953c70aec529549d1a17d989650b00437477c9d6f5af921e29a6bfba8d485a0ce86299dfc42ad313bc7
7
+ data.tar.gz: 80095193d0621395cf5f57eb7f3e3f6d8a069e5ee3a3f2e83aca08d05353d57d3b38ac0d8fb0ac27ade48dd462c91acad443ad03c62d49be1e527c406e37f210
@@ -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.3.0'
7
+ spec.version = '0.4.0'
8
8
  spec.authors = ['SaleMove TechMovers']
9
9
  spec.email = ['techmovers@salemove.com']
10
10
 
@@ -2,27 +2,34 @@ module Jaeger
2
2
  module Client
3
3
  # SpanContext holds the data for a span that gets inherited to child spans
4
4
  class SpanContext
5
+ module Flags
6
+ SAMPLED = 0x01
7
+ DEBUG = 0x02
8
+ end
9
+
5
10
  def self.create_parent_context
6
11
  trace_id = TraceId.generate
7
12
  span_id = TraceId.generate
8
- new(trace_id: trace_id, span_id: span_id)
13
+ flags = Flags::SAMPLED
14
+ new(trace_id: trace_id, span_id: span_id, flags: flags)
9
15
  end
10
16
 
11
17
  def self.create_from_parent_context(span_context)
12
18
  trace_id = span_context.trace_id
13
19
  parent_id = span_context.span_id
20
+ flags = span_context.flags
14
21
  span_id = TraceId.generate
15
- new(span_id: span_id, parent_id: parent_id, trace_id: trace_id)
22
+ new(span_id: span_id, parent_id: parent_id, trace_id: trace_id, flags: flags)
16
23
  end
17
24
 
18
25
  attr_reader :span_id, :parent_id, :trace_id, :baggage, :flags
19
26
 
20
- def initialize(span_id:, parent_id: 0, trace_id:, baggage: {})
27
+ def initialize(span_id:, parent_id: 0, trace_id:, flags:, baggage: {})
21
28
  @span_id = span_id
22
29
  @parent_id = parent_id
23
30
  @trace_id = trace_id
24
31
  @baggage = baggage
25
- @flags = 0
32
+ @flags = flags
26
33
  end
27
34
 
28
35
  def inspect
@@ -75,13 +75,14 @@ module Jaeger
75
75
  trace_arguments = trace.split(':').map {|arg| arg.to_i(16)}
76
76
  return nil if trace_arguments.size != 4
77
77
 
78
- trace_id, span_id, parent_id, _flags = trace_arguments
78
+ trace_id, span_id, parent_id, flags = trace_arguments
79
79
 
80
80
  if trace_id != 0 && span_id != 0
81
81
  SpanContext.new(
82
82
  trace_id: trace_id,
83
83
  parent_id: parent_id,
84
- span_id: span_id
84
+ span_id: span_id,
85
+ flags: flags
85
86
  )
86
87
  else
87
88
  nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jaeger-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SaleMove TechMovers