Class: Instana::SpanContext
- Inherits:
-
Object
- Object
- Instana::SpanContext
- Defined in:
- lib/instana/tracing/span_context.rb
Instance Attribute Summary collapse
-
#baggage ⇒ Object
Returns the value of attribute baggage.
-
#span_id ⇒ Object
Returns the value of attribute span_id.
-
#trace_id ⇒ Object
Returns the value of attribute trace_id.
Instance Method Summary collapse
-
#initialize(tid, sid, level = 1, baggage = {}) ⇒ SpanContext
constructor
Create a new SpanContext.
- #span_id_header ⇒ Object
- #to_hash ⇒ Object
- #trace_id_header ⇒ Object
Constructor Details
#initialize(tid, sid, level = 1, baggage = {}) ⇒ SpanContext
Create a new SpanContext
14 15 16 17 18 19 |
# File 'lib/instana/tracing/span_context.rb', line 14 def initialize(tid, sid, level = 1, baggage = {}) @trace_id = tid @span_id = sid @level = level @baggage = baggage end |
Instance Attribute Details
#baggage ⇒ Object
Returns the value of attribute baggage.
5 6 7 |
# File 'lib/instana/tracing/span_context.rb', line 5 def baggage @baggage end |
#span_id ⇒ Object
Returns the value of attribute span_id.
4 5 6 |
# File 'lib/instana/tracing/span_context.rb', line 4 def span_id @span_id end |
#trace_id ⇒ Object
Returns the value of attribute trace_id.
3 4 5 |
# File 'lib/instana/tracing/span_context.rb', line 3 def trace_id @trace_id end |
Instance Method Details
#span_id_header ⇒ Object
25 26 27 |
# File 'lib/instana/tracing/span_context.rb', line 25 def span_id_header ::Instana::Util.id_to_header(@span_id) end |
#to_hash ⇒ Object
29 30 31 |
# File 'lib/instana/tracing/span_context.rb', line 29 def to_hash { :trace_id => @trace_id, :span_id => @span_id } end |
#trace_id_header ⇒ Object
21 22 23 |
# File 'lib/instana/tracing/span_context.rb', line 21 def trace_id_header ::Instana::Util.id_to_header(@trace_id) end |