Class: LightStep::SpanContext
- Inherits:
-
Object
- Object
- LightStep::SpanContext
- Defined in:
- lib/lightstep/span_context.rb
Overview
SpanContext holds the data for a span that gets inherited to child spans
Constant Summary collapse
- ZERO_PADDING =
'0' * 16
Instance Attribute Summary collapse
-
#baggage ⇒ Object
readonly
Returns the value of attribute baggage.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#sampled ⇒ Object
(also: #sampled?)
readonly
Returns the value of attribute sampled.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
-
#trace_id16 ⇒ Object
readonly
Returns the value of attribute trace_id16.
Instance Method Summary collapse
-
#initialize(id:, trace_id:, sampled: true, baggage: {}) ⇒ SpanContext
constructor
A new instance of SpanContext.
Constructor Details
#initialize(id:, trace_id:, sampled: true, baggage: {}) ⇒ SpanContext
Returns a new instance of SpanContext.
11 12 13 14 15 16 17 |
# File 'lib/lightstep/span_context.rb', line 11 def initialize(id:, trace_id:, sampled: true, baggage: {}) @id = id.freeze @trace_id16 = pad_id(trace_id).freeze @trace_id = truncate_id(trace_id).freeze @sampled = sampled @baggage = baggage.freeze end |
Instance Attribute Details
#baggage ⇒ Object (readonly)
Returns the value of attribute baggage.
6 7 8 |
# File 'lib/lightstep/span_context.rb', line 6 def baggage @baggage end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/lightstep/span_context.rb', line 6 def id @id end |
#sampled ⇒ Object (readonly) Also known as: sampled?
Returns the value of attribute sampled.
6 7 8 |
# File 'lib/lightstep/span_context.rb', line 6 def sampled @sampled end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
6 7 8 |
# File 'lib/lightstep/span_context.rb', line 6 def trace_id @trace_id end |
#trace_id16 ⇒ Object (readonly)
Returns the value of attribute trace_id16.
6 7 8 |
# File 'lib/lightstep/span_context.rb', line 6 def trace_id16 @trace_id16 end |