Method: Aws::Xray.start_subsegment

Defined in:
lib/aws/xray.rb

.start_subsegment(name:, remote:) {|Aws::Xray::Subsegment| ... } ⇒ Object

Start subsegment if current thread has tracing context then send the subsegment to X-Ray daemon. Rescue all exceptions and record the exception to the subsegment. Then re-raise the exception.

Yields:

Returns:

  • (Object)

    result of given block



48
49
50
51
52
53
54
# File 'lib/aws/xray.rb', line 48

def start_subsegment(name:, remote:, &block)
  if started?
    current_context.start_subsegment(name: name, remote: remote, &block)
  else
    block.call(Subsegment.build_null)
  end
end