Class: OpenTracingTestTracer::SpanContext
- Inherits:
-
Object
- Object
- OpenTracingTestTracer::SpanContext
- Defined in:
- lib/opentracing_test_tracer/span_context.rb
Overview
SpanContext holds the data for a span that gets inherited to child spans
Instance Attribute Summary collapse
-
#baggage ⇒ Object
readonly
Returns the value of attribute baggage.
-
#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: nil, trace_id:, baggage: {}) ⇒ SpanContext
constructor
A new instance of SpanContext.
- #to_s ⇒ Object
Constructor Details
#initialize(span_id:, parent_id: nil, trace_id:, baggage: {}) ⇒ SpanContext
Returns a new instance of SpanContext.
21 22 23 24 25 26 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 21 def initialize(span_id:, parent_id: nil, trace_id:, baggage: {}) @span_id = span_id @parent_id = parent_id @trace_id = trace_id @baggage = baggage end |
Instance Attribute Details
#baggage ⇒ Object (readonly)
Returns the value of attribute baggage.
19 20 21 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 19 def baggage @baggage end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
19 20 21 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 19 def parent_id @parent_id end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
19 20 21 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 19 def span_id @span_id end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
19 20 21 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 19 def trace_id @trace_id end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
28 29 30 31 32 33 |
# File 'lib/opentracing_test_tracer/span_context.rb', line 28 def to_s "SpanContext(trace_id=#{@trace_id}, " \ "span_id=#{@span_id}, " \ "parent_id=#{@parent_id}, " \ "baggage=#{@baggage})" end |