Sha256: 27118eb84291165e4e6de8c776611597e3318a15956b75c363b3a73e437b4f50
Contents?: true
Size: 1.22 KB
Versions: 16
Compression:
Stored size: 1.22 KB
Contents
# typed: true module Datadog module Tracing module Pipeline # This processor executes the configured `operation` for each {Datadog::Tracing::Span} # in a {Datadog::Tracing::TraceSegment}. # # @public_api class SpanProcessor # You can either provide an `operation` object or a block to this method. # # Both have the same semantics as `operation`. # `operation` is used if both `operation` and a block are present. # # @param [#call(Datadog::Tracing::Span)] operation 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 # Invokes `operation#call` for each spans in the `trace` argument. # @param [Datadog::Tracing::TraceSegment] trace a trace segment. # @return [Datadog::Tracing::TraceSegment] the `trace` provided as an argument. # @!visibility private def call(trace) trace.spans.each do |span| @operation.call(span) rescue next end trace end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems