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 +4 -4
- data/jaeger-client.gemspec +1 -1
- data/lib/jaeger/client/span_context.rb +11 -4
- data/lib/jaeger/client/tracer.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82dd8d1de04e467f45bade61aecf422ee7ce5157
|
4
|
+
data.tar.gz: 60c024c46753bf95b8d8e1ce6ec4d36bb24d4a58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f84be392b067291900e3f8a0f229641b61cf4c5a319c9953c70aec529549d1a17d989650b00437477c9d6f5af921e29a6bfba8d485a0ce86299dfc42ad313bc7
|
7
|
+
data.tar.gz: 80095193d0621395cf5f57eb7f3e3f6d8a069e5ee3a3f2e83aca08d05353d57d3b38ac0d8fb0ac27ade48dd462c91acad443ad03c62d49be1e527c406e37f210
|
data/jaeger-client.gemspec
CHANGED
@@ -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
|
-
|
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 =
|
32
|
+
@flags = flags
|
26
33
|
end
|
27
34
|
|
28
35
|
def inspect
|
data/lib/jaeger/client/tracer.rb
CHANGED
@@ -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,
|
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
|