Module: Datadog::OpenTelemetry::Trace

Defined in:
lib/datadog/opentelemetry/trace.rb,
lib/datadog/opentelemetry/api/trace/span.rb,
lib/datadog/opentelemetry/sdk/trace/span.rb

Overview

OpenTelemetry utilities related to the respective Datadog trace.

Defined Under Namespace

Modules: Span

Class Method Summary collapse

Class Method Details

.start_trace_copy(trace, parent_span: nil) ⇒ TraceOperation

Creates a new TraceOperation object that can be attached to a new OpenTelemetry span. If ‘parent_span` is provided, then that span is set as the currently active parent span.

Returns:

  • (TraceOperation)


16
17
18
19
20
21
22
23
24
25
# File 'lib/datadog/opentelemetry/trace.rb', line 16

def start_trace_copy(trace, parent_span: nil)
  digest = if parent_span
             digest_with_parent_span(trace, parent_span)
           else
             trace.to_digest
           end

  # Create a new TraceOperation, attached to the current Datadog Tracer.
  Datadog::Tracing.continue_trace!(digest)
end