Sha256: 15d15e3e127aed149c0996b454bd001f4c807795e4bbf4e3ba3e20f885a34a45

Contents?: true

Size: 697 Bytes

Versions: 16

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  class Metadata
    # @api private
    class SystemInfo
      def initialize(config)
        @config = config

        @hostname = @config.hostname || `hostname`.chomp
        @architecture = gem_platform.cpu
        @platform = gem_platform.os

        container_info = ContainerInfo.read!
        @container = container_info.container
        @kubernetes = container_info.kubernetes
      end

      attr_reader :hostname, :architecture, :platform, :container, :kubernetes

      private

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

require 'elastic_apm/metadata/system_info/container_info'

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.5.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.4.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.3.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.2.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.1.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-3.0.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.12.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.11.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.10.1 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.10.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.9.1 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.9.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.8.1 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.8.0 lib/elastic_apm/metadata/system_info.rb
elastic-apm-2.7.0 lib/elastic_apm/metadata/system_info.rb