Module: Datadog::Tracing::Contrib::SpanAttributeSchema
- Defined in:
- lib/datadog/tracing/contrib/span_attribute_schema.rb
Overview
Contains methods for fetching values according to span attributes schema
Constant Summary collapse
- REFLEXIVE_SOURCES =
[Tracing::Metadata::Ext::TAG_PEER_SERVICE].freeze
- NO_SOURCE =
[].freeze
Class Method Summary collapse
Class Method Details
.fetch_service_name(env, default) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/datadog/tracing/contrib/span_attribute_schema.rb', line 13 def self.fetch_service_name(env, default) ENV.fetch(env) do if Datadog.configuration.tracing.contrib.global_default_service_name.enabled return Datadog.configuration.service end default end end |
.set_peer_service!(span, sources) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/datadog/tracing/contrib/span_attribute_schema.rb', line 23 def self.set_peer_service!(span, sources) # Acquire all peer.service values as well as any potential remapping peer_service_val, peer_service_source = set_peer_service_from_source(span, sources) remap_val = Datadog.configuration.tracing.contrib.peer_service_mapping[peer_service_val] # Only continue to setting peer.service if actual source is found return false unless peer_service_source span.set_tag(Tracing::Contrib::Ext::Metadata::TAG_PEER_SERVICE_SOURCE, peer_service_source) # Set peer.service to remapped value if found otherwise normally set peer.service if remap_val span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, remap_val) span.set_tag(Tracing::Contrib::Ext::Metadata::TAG_PEER_SERVICE_REMAP, peer_service_val) else span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, peer_service_val) end true end |