Sha256: ca65e3998d6464cc7dae19225179e799a1c0a46f1c5eeeb7e74a1def8c6c573f

Contents?: true

Size: 915 Bytes

Versions: 4

Compression:

Stored size: 915 Bytes

Contents

# typed: true

require 'datadog/tracing/metadata/ext'
require 'datadog/tracing/flush'

module Datadog
  module CI
    module Flush
      # Common behavior for CI flushing
      module Tagging
        # Decorate a trace with CI tags
        def get_trace(trace_op)
          trace = trace_op.flush!

          # Origin tag is required on every span
          trace.spans.each do |span|
            span.set_tag(
              Tracing::Metadata::Ext::Distributed::TAG_ORIGIN,
              trace.origin
            )
          end

          trace
        end
      end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/ci/flush.rb
ddtrace-1.1.0 lib/datadog/ci/flush.rb
ddtrace-1.0.0 lib/datadog/ci/flush.rb
ddtrace-1.0.0.beta2 lib/datadog/ci/flush.rb