Class: SplunkTracing::SpanContext

Inherits:
Object
  • Object
show all
Defined in:
lib/splunktracing/span_context.rb

Overview

SpanContext holds the data for a span that gets inherited to child spans

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, trace_id:, parent_id: nil, baggage: {}) ⇒ SpanContext

Returns a new instance of SpanContext.



6
7
8
9
10
11
# File 'lib/splunktracing/span_context.rb', line 6

def initialize(id:, trace_id:, parent_id: nil, baggage: {})
  @id = id.freeze
  @trace_id = trace_id.freeze
  @parent_id = parent_id.freeze
  @baggage = baggage.freeze
end

Instance Attribute Details

#baggageObject (readonly)

Returns the value of attribute baggage.



4
5
6
# File 'lib/splunktracing/span_context.rb', line 4

def baggage
  @baggage
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/splunktracing/span_context.rb', line 4

def id
  @id
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



4
5
6
# File 'lib/splunktracing/span_context.rb', line 4

def parent_id
  @parent_id
end

#trace_idObject (readonly)

Returns the value of attribute trace_id.



4
5
6
# File 'lib/splunktracing/span_context.rb', line 4

def trace_id
  @trace_id
end