module Labkit::Correlation::CorrelationId
CorrelationId
module provides access the Correlation-ID of the current request
Constants
- LOG_KEY
Public Class Methods
current_id()
click to toggle source
# File lib/labkit/correlation/correlation_id.rb, line 17 def current_id Labkit::Context.correlation_id end
current_or_new_id()
click to toggle source
# File lib/labkit/correlation/correlation_id.rb, line 21 def current_or_new_id current_id || Labkit::Context.push.correlation_id end
use_id(correlation_id) { |correlation_id| ... }
click to toggle source
# File lib/labkit/correlation/correlation_id.rb, line 11 def use_id(correlation_id) Labkit::Context.with_context(LOG_KEY => correlation_id) do |context| yield(context.correlation_id) end end