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) }
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.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger: Datadog.logger, 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(logger: Datadog.logger, on_error: nil) ⇒ Events
Returns a new instance of Events.
398 399 400 401 402 403 |
# File 'lib/datadog/tracing/span_operation.rb', line 398 def initialize(logger: Datadog.logger, on_error: nil) @logger = logger @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.
392 393 394 |
# File 'lib/datadog/tracing/span_operation.rb', line 392 def after_finish @after_finish end |
#after_stop ⇒ Object (readonly)
Returns the value of attribute after_stop.
392 393 394 |
# File 'lib/datadog/tracing/span_operation.rb', line 392 def after_stop @after_stop end |
#before_start ⇒ Object (readonly)
Returns the value of attribute before_start.
392 393 394 |
# File 'lib/datadog/tracing/span_operation.rb', line 392 def before_start @before_start end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
392 393 394 |
# File 'lib/datadog/tracing/span_operation.rb', line 392 def logger @logger end |
Instance Method Details
#on_error ⇒ Object
This event is lazily initialized as error paths are normally less common that non-error paths.
407 408 409 |
# File 'lib/datadog/tracing/span_operation.rb', line 407 def on_error @on_error ||= OnError.new(DEFAULT_ON_ERROR, logger: logger) end |