class Datadog::Tracing::Pipeline::SpanProcessor

@public_api
in a {Datadog::Tracing::TraceSegment}.
This processor executes the configured ‘operation` for each {Datadog::Tracing::Span}

def call(trace)

Returns:
  • (Datadog::Tracing::TraceSegment) - the `trace` provided as an argument.

Parameters:
  • trace (Datadog::Tracing::TraceSegment) -- a trace segment.
def call(trace)
  trace.spans.each do |span|
    @operation.call(span) rescue next
  end
  trace
end

def initialize(operation = nil, &block)

Parameters:
  • operation (#call(Datadog::Tracing::Span)) -- a callable that can modify the span.
def initialize(operation = nil, &block)
  callable = operation || block
  raise(ArgumentError) unless callable.respond_to?(:call)
  @operation = operation || block
end