Sha256: b50658086b7e2aff3f3b0e19a7068c730af388ef43a3715adf9b3a4a1b7ce420

Contents?: true

Size: 735 Bytes

Versions: 4

Compression:

Stored size: 735 Bytes

Contents

module Instana
  class SpanContext
    attr_accessor :trace_id
    attr_accessor :span_id
    attr_accessor :baggage

    # Create a new SpanContext
    #
    # @param tid [Integer] the trace ID
    # @param sid [Integer] the span ID
    # @param level [Integer] default 1
    # @param baggage [Hash] baggage applied to this trace
    #
    def initialize(tid, sid, level = 1, baggage = nil)
      @trace_id = tid
      @span_id = sid
      @level = level
      @baggage = baggage
    end

    def trace_id_header
      ::Instana::Util.id_to_header(@trace_id)
    end

    def span_id_header
      ::Instana::Util.id_to_header(@span_id)
    end

    def to_hash
      { :trace_id => @trace_id, :span_id => @span_id }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
instana-1.10.1-java lib/instana/tracing/span_context.rb
instana-1.10.1 lib/instana/tracing/span_context.rb
instana-1.10.0 lib/instana/tracing/span_context.rb
instana-1.10.0.slimfast lib/instana/tracing/span_context.rb