Class: LittleGhost::Instrumentation::Subscriber
- Inherits:
-
Object
- Object
- LittleGhost::Instrumentation::Subscriber
- Defined in:
- lib/little_ghost/instrumentation.rb
Overview
Subclass Subscriber to connect a telemetry backend.
Override the callbacks a backend supports. start and finish receive the
same operation name and correlated attributes. emit receives point
events. Implementations may return a propagation carrier from
#trace_context. Callbacks should be thread-safe.
Direct Known Subclasses
Instance Method Summary collapse
-
#emit(_name, _attributes) ⇒ Object
Called for a point-in-time instrumentation event.
-
#finish(_name, _attributes) ⇒ Object
Called when a lifecycle operation finishes.
-
#flush(timeout: nil) ⇒ Object
Flushes buffered telemetry within an optional timeout budget.
-
#shutdown(timeout: nil) ⇒ Object
Releases subscriber resources within an optional timeout budget.
-
#start(_name, _attributes) ⇒ Object
Called when a lifecycle operation starts.
-
#trace_context ⇒ Object
Supplies trace fields that should travel with downstream work.
Instance Method Details
#emit(_name, _attributes) ⇒ Object
Called for a point-in-time instrumentation event.
43 44 |
# File 'lib/little_ghost/instrumentation.rb', line 43 def emit(_name, _attributes) = nil # Flushes buffered telemetry within an optional timeout budget. |
#finish(_name, _attributes) ⇒ Object
Called when a lifecycle operation finishes.
41 42 |
# File 'lib/little_ghost/instrumentation.rb', line 41 def finish(_name, _attributes) = nil # Called for a point-in-time instrumentation event. |
#flush(timeout: nil) ⇒ Object
Flushes buffered telemetry within an optional timeout budget.
45 46 |
# File 'lib/little_ghost/instrumentation.rb', line 45 def flush(timeout: nil) = nil # Releases subscriber resources within an optional timeout budget. |
#shutdown(timeout: nil) ⇒ Object
Releases subscriber resources within an optional timeout budget.
47 48 |
# File 'lib/little_ghost/instrumentation.rb', line 47 def shutdown(timeout: nil) = nil # Supplies trace fields that should travel with downstream work. |
#start(_name, _attributes) ⇒ Object
Called when a lifecycle operation starts.
39 40 |
# File 'lib/little_ghost/instrumentation.rb', line 39 def start(_name, _attributes) = nil # Called when a lifecycle operation finishes. |
#trace_context ⇒ Object
Supplies trace fields that should travel with downstream work.
49 |
# File 'lib/little_ghost/instrumentation.rb', line 49 def trace_context(**) = {} |