Method: LightStep::Span#set_baggage_item

Defined in:
lib/lightstep/span.rb

#set_baggage_item(key, value) ⇒ Object

Set a baggage item on the span

Parameters:

  • key (String)

    the key of the baggage item

  • value (String)

    the value of the baggage item



86
87
88
89
90
91
92
93
94
95
# File 'lib/lightstep/span.rb', line 86

def set_baggage_item(key, value)
  @context = SpanContext.new(
    id: context.id,
    trace_id: context.trace_id,
    trace_id_upper64: context.trace_id_upper64,
    sampled: context.sampled?,
    baggage: context.baggage.merge({key => value})
  )
  self
end