Sha256: ab5d819752e5c9c14d5438076bd096297d3ace1ff481af434f8d57723bcd949e

Contents?: true

Size: 757 Bytes

Versions: 22

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

module Datadog
  module OpenTracer
    # Creates new Datadog::OpenTracer::SpanContext
    module SpanContextFactory
      module_function

      def build(datadog_context:, datadog_trace_digest: nil, baggage: {})
        SpanContext.new(
          datadog_context: datadog_context,
          datadog_trace_digest: datadog_trace_digest,
          baggage: baggage.dup
        )
      end

      def clone(span_context:, baggage: {})
        SpanContext.new(
          datadog_context: span_context.datadog_context,
          datadog_trace_digest: span_context.datadog_trace_digest,
          # Merge baggage from previous SpanContext
          baggage: span_context.baggage.merge(baggage)
        )
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.23.2 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.23.1 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.22.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.21.1 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.21.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.20.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.19.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.18.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.17.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.16.2 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.16.1 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.16.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.15.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.14.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.13.1 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.13.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.12.1 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.12.0 lib/datadog/opentracer/span_context_factory.rb
ddtrace-1.11.1 lib/datadog/opentracer/span_context_factory.rb