Sha256: 2ba839b9dcc560a50df43e5f9661e382431641ea6cff260b9e8d92f96d5a7c07

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 Bytes

Contents

# typed: true
require 'ddtrace/context_flush'

module Datadog
  module CI
    module ContextFlush
      # Common behavior for CI flushing
      module Tagging
        # Decorate a trace with CI tags
        def get_trace(context)
          context.get do |trace|
            # Origin tag is required on every span
            trace.each { |span| context.attach_origin(span) } if trace
          end
        end
      end

      # Consumes only completed traces (where all spans have finished)
      class Finished < Datadog::ContextFlush::Finished
        prepend Tagging
      end

      # Performs partial trace flushing to avoid large traces residing in memory for too long
      class Partial < Datadog::ContextFlush::Partial
        prepend Tagging
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/datadog/ci/context_flush.rb
ddtrace-0.54.1 lib/datadog/ci/context_flush.rb
ddtrace-0.54.0 lib/datadog/ci/context_flush.rb
ddtrace-0.53.0 lib/datadog/ci/context_flush.rb
ddtrace-0.52.0 lib/datadog/ci/context_flush.rb