Module: Datadog::Correlation
- Defined in:
- lib/ddtrace/correlation.rb
Overview
Contains behavior for managing correlations with tracing e.g. Retrieve a correlation to the current trace for logging, etc.
Constant Summary collapse
- Identifier =
Struct representing correlation
Struct.new(:trace_id, :span_id, :env, :version) do def initialize(*args) super self.trace_id = trace_id || 0 self.span_id = span_id || 0 self.env = env || Datadog.configuration.env self.version = version || Datadog.configuration.version end def to_s str = "#{Ext::Correlation::ATTR_TRACE_ID}=#{trace_id}" str += " #{Ext::Correlation::ATTR_SPAN_ID}=#{span_id}" str += " #{Ext::Correlation::ATTR_ENV}=#{env}" str += " #{Ext::Correlation::ATTR_VERSION}=#{version}" str end end.freeze
Class Method Summary collapse
-
.identifier_from_context(context) ⇒ Object
Produces a CorrelationIdentifier from the Context provided.
Class Method Details
.identifier_from_context(context) ⇒ Object
Produces a CorrelationIdentifier from the Context provided
30 31 32 33 |
# File 'lib/ddtrace/correlation.rb', line 30 def identifier_from_context(context) return Identifier.new.freeze if context.nil? Identifier.new(context.trace_id, context.span_id).freeze end |