Class: Jaeger::Client::SpanContext
- Inherits:
-
Object
- Object
- Jaeger::Client::SpanContext
- Defined in:
- lib/jaeger/client/span_context.rb
Overview
SpanContext holds the data for a span that gets inherited to child spans
Defined Under Namespace
Modules: Flags
Instance Attribute Summary collapse
-
#baggage ⇒ Object
readonly
Returns the value of attribute baggage.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#span_id ⇒ Object
readonly
Returns the value of attribute span_id.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(span_id:, parent_id: 0, trace_id:, flags:, baggage: {}) ⇒ SpanContext
constructor
A new instance of SpanContext.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(span_id:, parent_id: 0, trace_id:, flags:, baggage: {}) ⇒ SpanContext
Returns a new instance of SpanContext.
27 28 29 30 31 32 33 |
# File 'lib/jaeger/client/span_context.rb', line 27 def initialize(span_id:, parent_id: 0, trace_id:, flags:, baggage: {}) @span_id = span_id @parent_id = parent_id @trace_id = trace_id @baggage = baggage @flags = flags end |
Instance Attribute Details
#baggage ⇒ Object (readonly)
Returns the value of attribute baggage.
25 26 27 |
# File 'lib/jaeger/client/span_context.rb', line 25 def baggage @baggage end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
25 26 27 |
# File 'lib/jaeger/client/span_context.rb', line 25 def flags @flags end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
25 26 27 |
# File 'lib/jaeger/client/span_context.rb', line 25 def parent_id @parent_id end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
25 26 27 |
# File 'lib/jaeger/client/span_context.rb', line 25 def span_id @span_id end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
25 26 27 |
# File 'lib/jaeger/client/span_context.rb', line 25 def trace_id @trace_id end |
Class Method Details
.create_from_parent_context(span_context) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/jaeger/client/span_context.rb', line 17 def self.create_from_parent_context(span_context) trace_id = span_context.trace_id parent_id = span_context.span_id flags = span_context.flags span_id = TraceId.generate new(span_id: span_id, parent_id: parent_id, trace_id: trace_id, flags: flags) end |
Instance Method Details
#inspect ⇒ Object
35 36 37 |
# File 'lib/jaeger/client/span_context.rb', line 35 def inspect to_s end |
#to_s ⇒ Object
39 40 41 42 43 44 |
# File 'lib/jaeger/client/span_context.rb', line 39 def to_s "#<SpanContext @span_id=#{span_id.to_s(16)} " + "@parent_id=#{parent_id.to_s(16)} " + "@trace_id=#{trace_id.to_s(16)} " + "@flags=#{flags}>" end |