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
permalink #initialize(on_error: nil) ⇒ Events
Returns a new instance of Events.
356 357 358 359 360 |
# File 'lib/datadog/tracing/span_operation.rb', line 356 def initialize(on_error: nil) @after_finish = AfterFinish.new @after_stop = AfterStop.new @before_start = BeforeStart.new end |
Instance Attribute Details
permalink #after_finish ⇒ Object (readonly)
Returns the value of attribute after_finish.
351 352 353 |
# File 'lib/datadog/tracing/span_operation.rb', line 351 def after_finish @after_finish end |
permalink #after_stop ⇒ Object (readonly)
Returns the value of attribute after_stop.
351 352 353 |
# File 'lib/datadog/tracing/span_operation.rb', line 351 def after_stop @after_stop end |
permalink #before_start ⇒ Object (readonly)
Returns the value of attribute before_start.
351 352 353 |
# File 'lib/datadog/tracing/span_operation.rb', line 351 def before_start @before_start end |
Instance Method Details
permalink #on_error ⇒ Object
This event is lazily initialized as error paths are normally less common that non-error paths.
364 365 366 |
# File 'lib/datadog/tracing/span_operation.rb', line 364 def on_error @on_error ||= OnError.new(DEFAULT_ON_ERROR) end |