class ElasticAPM::Metadata::ServiceInfo

@api private

Attributes

agent[R]
environment[R]
framework[R]
language[R]
name[R]
node_name[R]
runtime[R]
version[R]

Public Class Methods

new(config) click to toggle source
# File lib/elastic_apm/metadata/service_info.rb, line 39
def initialize(config)
  @config = config

  @name = @config.service_name
  @node_name = @config.service_node_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
end

Private Instance Methods

lookup_runtime() click to toggle source
# File lib/elastic_apm/metadata/service_info.rb, line 60
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