class TCellAgent::Rust::AgentConfig

Public Class Methods

new(configuration) click to toggle source
# File lib/tcell_agent/rust/agent_config.rb, line 9
def initialize(configuration)
  self['agent_type'] = 'Ruby'
  self['agent_version'] = TCellAgent::VERSION
  self['default_cache_dir'] = File.join(Dir.getwd, 'tcell/cache')
  self['default_config_file_dir'] = File.join(Dir.getwd, 'config')
  self['default_log_dir'] = File.join(Dir.getwd, 'tcell/logs')
  self['default_preload_policy_file_dir'] = Dir.getwd

  if defined?(ConfigInitializer)
    overrides = Models.clean_nils(AgentConfigOverrides.new(configuration))
    self['overrides'] = overrides
  else
    self['overrides'] = { 'applications' => [{ :enable_json_body_inspection => true }],
                          'config_file_path' => configuration.get_config_file_path }
  end

  set_agent_details
end

Public Instance Methods

set_agent_details() click to toggle source
# File lib/tcell_agent/rust/agent_config.rb, line 28
def set_agent_details
  framework_details = if defined?(Rails)
                        TCellAgent::Instrumentation::Rails.framework_details
                      else
                        {}
                      end

  self['agent_details'] = { 'language' => 'Ruby',
                            'language_version' => RUBY_VERSION,
                            'app_framework' => framework_details['app_framework'],
                            'app_framework_version' => framework_details['app_framework_version'] }
end