class ElasticAPM::Metadata::ServiceInfo

@api private

def initialize(config)

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

def lookup_runtime

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