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
# File 'lib/datadog/core/environment/process.rb', line 15

def self.serialized
  return @serialized if defined?(@serialized)

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

.tagsArray<String>

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 an array in the format [“k1:v1”,“k2:v2”,“k3:v3”]

Returns:

  • (Array<String>)

    array of normalized key:value pairs



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/datadog/core/environment/process.rb', line 23

def self.tags
  return @tags if defined?(@tags)
  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)}"

  @tags = tags.freeze
end