Class: ElasticAPM::Metadata::SystemInfo Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/metadata/system_info.rb,
lib/elastic_apm/metadata/system_info/container_info.rb

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

Defined Under Namespace

Classes: ContainerInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ SystemInfo

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.

Returns a new instance of SystemInfo.



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/elastic_apm/metadata/system_info.rb', line 24

def initialize(config)
  @config = config

  @configured_hostname = @config.hostname
  @detected_hostname = detect_hostname
  @architecture = gem_platform.cpu
  @platform = gem_platform.os

  container_info = ContainerInfo.read!(@detected_hostname)
  @container = container_info.container
  @kubernetes = container_info.kubernetes
end

Instance Attribute Details

#architectureObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def architecture
  @architecture
end

#configured_hostnameObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def configured_hostname
  @configured_hostname
end

#containerObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def container
  @container
end

#detected_hostnameObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def detected_hostname
  @detected_hostname
end

#kubernetesObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def kubernetes
  @kubernetes
end

#platformObject (readonly)

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.



37
38
39
# File 'lib/elastic_apm/metadata/system_info.rb', line 37

def platform
  @platform
end

Instance Method Details

#gem_platformObject

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.



46
47
48
# File 'lib/elastic_apm/metadata/system_info.rb', line 46

def gem_platform
  @gem_platform ||= Gem::Platform.local
end