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.



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_finishObject (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_stopObject (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_startObject (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_errorObject

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