Class: Datadog::Tracing::SpanOperation::Events

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Events

included

Constructor Details

#initialize(on_error: nil) ⇒ Events

Returns a new instance of Events.

[View source]

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

#after_finishObject (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

#after_stopObject (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

#before_startObject (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

#on_errorObject

This event is lazily initialized as error paths are normally less common that non-error paths.

[View source]

364
365
366
# File 'lib/datadog/tracing/span_operation.rb', line 364

def on_error
  @on_error ||= OnError.new(DEFAULT_ON_ERROR)
end