Module: Datadog::CI::TestVisibility::Flush::Tagging

Included in:
Finished, Partial
Defined in:
lib/datadog/ci/test_visibility/flush.rb

Overview

Common behavior for CI flushing

Instance Method Summary collapse

Instance Method Details

#get_trace(trace_op) ⇒ Object

Decorate a trace with CI tags



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/datadog/ci/test_visibility/flush.rb', line 13

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