Puppet Class: elasticsearch::log::hot_threads
- Defined in:
- modules/elasticsearch/manifests/log/hot_threads.pp
Overview
Class: elasticsearch::log::hot_threads
Install a systemd timer job to log the hot threads.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'modules/elasticsearch/manifests/log/hot_threads.pp', line 5
class elasticsearch::log::hot_threads {
ensure_packages('python3-yaml')
file { '/etc/elasticsearch_hot_threads.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
$script_name = 'elasticsearch_hot_threads_logger.py'
$script = "/usr/local/bin/${script_name}"
file { $script:
source => "puppet:///modules/elasticsearch/${script_name}",
mode => '0555',
}
# /var/log/elasticsearch/elasticsearch_hot_threads_errors.log contains only
# exceptions raised while executing. See hot_threads_cluster for
# individual cluster log file locations.
systemd::timer::job { 'elasticsearch-hot-threads-log':
command => $script,
description => 'Archive exception logs of hot elasticsearch threads',
user => 'elasticsearch',
monitoring_enabled => false,
logging_enabled => false,
interval => {
'start' => 'OnCalendar',
'interval' => '*-*-* *:00/5:00', # every 5 min
},
require => [Package['elasticsearch-oss'], File[$script]],
}
# The logrotate configuration for Elasticsearch will roll these logs just
# fine.
}
|