Class: Datadog::Tracing::Correlation::Identifier
- Inherits:
-
Object
- Object
- Datadog::Tracing::Correlation::Identifier
- Defined in:
- lib/datadog/tracing/correlation.rb
Overview
Represents current trace state with key identifiers
Constant Summary collapse
- LOG_ATTR_ENV =
'dd.env'.freeze
- LOG_ATTR_SERVICE =
'dd.service'.freeze
- LOG_ATTR_SPAN_ID =
'dd.span_id'.freeze
- LOG_ATTR_TRACE_ID =
'dd.trace_id'.freeze
- LOG_ATTR_VERSION =
'dd.version'.freeze
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#span_id ⇒ Object
readonly
Returns the value of attribute span_id.
-
#span_name ⇒ Object
readonly
Returns the value of attribute span_name.
-
#span_resource ⇒ Object
readonly
Returns the value of attribute span_resource.
-
#span_service ⇒ Object
readonly
Returns the value of attribute span_service.
-
#span_type ⇒ Object
readonly
Returns the value of attribute span_type.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
-
#trace_name ⇒ Object
readonly
Returns the value of attribute trace_name.
-
#trace_resource ⇒ Object
readonly
Returns the value of attribute trace_resource.
-
#trace_service ⇒ Object
readonly
Returns the value of attribute trace_service.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def env @env end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def service @service end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def span_id @span_id end |
#span_name ⇒ Object (readonly)
Returns the value of attribute span_name.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def span_name @span_name end |
#span_resource ⇒ Object (readonly)
Returns the value of attribute span_resource.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def span_resource @span_resource end |
#span_service ⇒ Object (readonly)
Returns the value of attribute span_service.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def span_service @span_service end |
#span_type ⇒ Object (readonly)
Returns the value of attribute span_type.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def span_type @span_type end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def trace_id @trace_id end |
#trace_name ⇒ Object (readonly)
Returns the value of attribute trace_name.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def trace_name @trace_name end |
#trace_resource ⇒ Object (readonly)
Returns the value of attribute trace_resource.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def trace_resource @trace_resource end |
#trace_service ⇒ Object (readonly)
Returns the value of attribute trace_service.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def trace_service @trace_service end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
19 20 21 |
# File 'lib/datadog/tracing/correlation.rb', line 19 def version @version end |
Instance Method Details
#to_log_format ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/datadog/tracing/correlation.rb', line 63 def to_log_format @log_format ||= begin attributes = [] attributes << "#{LOG_ATTR_ENV}=#{env}" unless env.nil? attributes << "#{LOG_ATTR_SERVICE}=#{service}" attributes << "#{LOG_ATTR_VERSION}=#{version}" unless version.nil? attributes << "#{LOG_ATTR_TRACE_ID}=#{trace_id}" attributes << "#{LOG_ATTR_SPAN_ID}=#{span_id}" attributes.join(' ') end end |