Class: TCellAgent::Rust::AgentConfig

Inherits:
Hash
  • Object
show all
Defined in:
lib/tcell_agent/rust/agent_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ AgentConfig

Returns a new instance of AgentConfig.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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
end