Class: Honeycomb::Context
- Inherits:
-
Object
- Object
- Honeycomb::Context
- Defined in:
- lib/honeycomb/context.rb
Overview
Stores the current span and trace context
Instance Attribute Summary collapse
-
#classic ⇒ Object
writeonly
Sets the attribute classic.
Instance Method Summary collapse
- #classic? ⇒ Boolean
- #current_span ⇒ Object
- #current_span=(span) ⇒ Object
- #current_trace ⇒ Object
- #span_sent(span) ⇒ Object
Instance Attribute Details
#classic=(value) ⇒ Object (writeonly)
Sets the attribute classic
6 7 8 |
# File 'lib/honeycomb/context.rb', line 6 def classic=(value) @classic = value end |
Instance Method Details
#classic? ⇒ Boolean
27 28 29 |
# File 'lib/honeycomb/context.rb', line 27 def classic? @classic end |
#current_span ⇒ Object
13 14 15 |
# File 'lib/honeycomb/context.rb', line 13 def current_span spans.last end |
#current_span=(span) ⇒ Object
17 18 19 |
# File 'lib/honeycomb/context.rb', line 17 def current_span=(span) spans << span end |
#current_trace ⇒ Object
7 8 9 10 11 |
# File 'lib/honeycomb/context.rb', line 7 def current_trace return if current_span.nil? current_span.trace end |
#span_sent(span) ⇒ Object
21 22 23 24 25 |
# File 'lib/honeycomb/context.rb', line 21 def span_sent(span) spans.last != span && raise(ArgumentError, "Incorrect span sent") spans.pop end |