2023-08-02 22:00:03 +02:00
|
|
|
# @summary Prometheus monitoring of Zulip server processes
|
2022-03-18 20:46:29 +01:00
|
|
|
#
|
2024-02-06 21:40:19 +01:00
|
|
|
class kandra::prometheus::process {
|
|
|
|
include kandra::prometheus::base
|
2023-03-30 20:02:42 +02:00
|
|
|
include zulip::supervisor
|
|
|
|
|
2022-03-18 20:46:29 +01:00
|
|
|
$version = $zulip::common::versions['process_exporter']['version']
|
|
|
|
$dir = "/srv/zulip-process_exporter-${version}"
|
|
|
|
$bin = "${dir}/process-exporter"
|
2023-08-02 22:00:03 +02:00
|
|
|
$conf = '/etc/zulip/process_exporter.yaml'
|
2022-03-18 20:46:29 +01:00
|
|
|
|
|
|
|
zulip::external_dep { 'process_exporter':
|
|
|
|
version => $version,
|
|
|
|
url => "https://github.com/ncabatoff/process-exporter/releases/download/v${version}/process-exporter-${version}.linux-${zulip::common::goarch}.tar.gz",
|
|
|
|
tarball_prefix => "process-exporter-${version}.linux-${zulip::common::goarch}",
|
|
|
|
}
|
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::firewall_allow { 'process_exporter': port => '9256' }
|
2022-03-18 20:46:29 +01:00
|
|
|
file { $conf:
|
|
|
|
ensure => file,
|
|
|
|
require => User[zulip],
|
|
|
|
owner => 'zulip',
|
|
|
|
group => 'zulip',
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/process_exporter.yaml',
|
2022-03-18 20:46:29 +01:00
|
|
|
}
|
2023-08-02 22:00:03 +02:00
|
|
|
file { "${zulip::common::supervisor_conf_dir}/prometheus_process_exporter.conf":
|
2022-03-18 20:46:29 +01:00
|
|
|
ensure => file,
|
|
|
|
require => [
|
|
|
|
User[zulip],
|
|
|
|
Package[supervisor],
|
|
|
|
Zulip::External_Dep['process_exporter'],
|
|
|
|
File[$conf],
|
|
|
|
],
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
content => template('kandra/supervisor/conf.d/prometheus_process_exporter.conf.template.erb'),
|
2022-03-18 20:46:29 +01:00
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
}
|