Class: Datadog::ContextFlush::Finished

Inherits:
Object
  • Object
show all
Defined in:
lib/ddtrace/context_flush.rb

Overview

Consumes only completed traces (where all spans have finished)

Instance Method Summary collapse

Instance Method Details

#consume!(context) ⇒ Array<Span>

Consumes and returns completed traces (where all spans have finished) from the provided context, if any.

Any traces consumed are removed from context as a side effect.

Returns:

  • (Array<Span>)

    trace to be flushed, or nil if the trace is not finished



11
12
13
14
# File 'lib/ddtrace/context_flush.rb', line 11

def consume!(context)
  trace, sampled = context.get
  trace if sampled
end