class ElasticAPM::Metadata::ServiceInfo

@api private

Attributes

agent[R]

rubocop:enable Metrics/MethodLength

environment[R]

rubocop:enable Metrics/MethodLength

framework[R]

rubocop:enable Metrics/MethodLength

language[R]

rubocop:enable Metrics/MethodLength

name[R]

rubocop:enable Metrics/MethodLength

runtime[R]

rubocop:enable Metrics/MethodLength

version[R]

rubocop:enable Metrics/MethodLength

Public Class Methods

new(config) click to toggle source

rubocop:disable Metrics/MethodLength

# File lib/elastic_apm/metadata/service_info.rb, line 22
def initialize(config)
  @config = config

  @name = @config.service_name
  @environment = @config.environment
  @agent = Agent.new(name: 'ruby', version: VERSION)
  @framework = Framework.new(
    name: @config.framework_name,
    version: @config.framework_version
  )
  @language = Language.new(name: 'ruby', version: RUBY_VERSION)
  @runtime = lookup_runtime
  @version = @config.service_version || Util.git_sha
end

Private Instance Methods

lookup_runtime() click to toggle source

rubocop:disable Metrics/MethodLength

# File lib/elastic_apm/metadata/service_info.rb, line 44
def lookup_runtime
  case RUBY_ENGINE
  when 'ruby'
    Runtime.new(
      name: RUBY_ENGINE,
      version: RUBY_VERSION || RUBY_ENGINE_VERSION
    )
  when 'jruby'
    Runtime.new(
      name: RUBY_ENGINE,
      version: JRUBY_VERSION || RUBY_ENGINE_VERSION
    )
  end
end