Module: Datadog::Tracing::Correlation

Defined in:
lib/datadog/tracing/correlation.rb

Overview

Contains behavior for managing correlations with tracing e.g. Retrieve a correlation to the current trace for logging, etc. This class is for usage with log correlation. To continue from a trace, users should use TraceDigest instead.

Defined Under Namespace

Classes: Identifier

Class Method Summary collapse

Class Method Details

.format_trace_id(trace_id) ⇒ Object



96
97
98
99
100
101
102
103
# File 'lib/datadog/tracing/correlation.rb', line 96

def format_trace_id(trace_id)
  if Datadog.configuration.tracing.trace_id_128_bit_logging_enabled &&
      !Tracing::Utils::TraceId.to_high_order(trace_id).zero?
    Kernel.format('%032x', trace_id)
  else
    Tracing::Utils::TraceId.to_low_order(trace_id).to_s
  end
end