Method: Datadog::Tracing.baggage

Defined in:
lib/datadog/tracing.rb

.baggageDatadog::Tracing::Distributed::Baggage

Returns the baggage for the current trace.

If there is no active trace, a new one is created.

Returns:



135
136
137
138
139
140
141
# File 'lib/datadog/tracing.rb', line 135

def baggage
  # Baggage should not be dependent on there being an active trace.
  # So we create a new TraceOperation if there isn't one.
  active_trace = self.active_trace || tracer.continue_trace!(nil)
  active_trace.baggage ||= {}
  active_trace.baggage
end