Module: Datadog::Core::Environment::Process Private

Defined in:
lib/datadog/core/environment/process.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Retrieves process level information such that it can be attached to various payloads

Class Method Summary collapse

Class Method Details

.serializedString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns a key/value part of serialized tags in the format of k1:v1,k2:v2,k3:v3

Returns:

  • (String)

    comma-separated normalized key:value pairs



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/datadog/core/environment/process.rb', line 15

def self.serialized
  return @serialized if defined?(@serialized)
  tags = []

  workdir = TagNormalizer.normalize_process_value(entrypoint_workdir.to_s)
  tags << "#{Environment::Ext::TAG_ENTRYPOINT_WORKDIR}:#{workdir}" unless workdir.empty?

  entry_name = TagNormalizer.normalize_process_value(entrypoint_name.to_s)
  tags << "#{Environment::Ext::TAG_ENTRYPOINT_NAME}:#{entry_name}" unless entry_name.empty?

  basedir = TagNormalizer.normalize_process_value(entrypoint_basedir.to_s)
  tags << "#{Environment::Ext::TAG_ENTRYPOINT_BASEDIR}:#{basedir}" unless basedir.empty?

  tags << "#{Environment::Ext::TAG_ENTRYPOINT_TYPE}:#{TagNormalizer.normalize(entrypoint_type, remove_digit_start_char: false)}"

  @serialized = tags.join(',').freeze
end