Class: Datadog::Tracing::SpanOperation::Events
- Inherits:
-
Object
- Object
- Datadog::Tracing::SpanOperation::Events
- Includes:
- Events
- Defined in:
- lib/datadog/tracing/span_operation.rb
Overview
Callback behavior
Defined Under Namespace
Classes: AfterFinish, AfterStop, BeforeStart, OnError
Constant Summary collapse
- DEFAULT_ON_ERROR =
proc { |span_op, error| span_op.set_error(error) unless span_op.nil? }
Instance Attribute Summary collapse
-
#after_finish ⇒ Object
readonly
Returns the value of attribute after_finish.
-
#after_stop ⇒ Object
readonly
Returns the value of attribute after_stop.
-
#before_start ⇒ Object
readonly
Returns the value of attribute before_start.
Instance Method Summary collapse
-
#initialize(on_error: nil) ⇒ Events
constructor
A new instance of Events.
-
#on_error ⇒ Object
This event is lazily initialized as error paths are normally less common that non-error paths.
Methods included from Events
Constructor Details
#initialize(on_error: nil) ⇒ Events
Returns a new instance of Events.
345 346 347 348 349 |
# File 'lib/datadog/tracing/span_operation.rb', line 345 def initialize(on_error: nil) @after_finish = AfterFinish.new @after_stop = AfterStop.new @before_start = BeforeStart.new end |
Instance Attribute Details
#after_finish ⇒ Object (readonly)
Returns the value of attribute after_finish.
340 341 342 |
# File 'lib/datadog/tracing/span_operation.rb', line 340 def after_finish @after_finish end |
#after_stop ⇒ Object (readonly)
Returns the value of attribute after_stop.
340 341 342 |
# File 'lib/datadog/tracing/span_operation.rb', line 340 def after_stop @after_stop end |
#before_start ⇒ Object (readonly)
Returns the value of attribute before_start.
340 341 342 |
# File 'lib/datadog/tracing/span_operation.rb', line 340 def before_start @before_start end |
Instance Method Details
#on_error ⇒ Object
This event is lazily initialized as error paths are normally less common that non-error paths.
353 354 355 |
# File 'lib/datadog/tracing/span_operation.rb', line 353 def on_error @on_error ||= OnError.new(DEFAULT_ON_ERROR) end |