puppet: Add a redis exporter.

This commit is contained in:
Alex Vandiver 2022-05-03 11:51:01 -07:00 committed by Tim Abbott
parent 163910b765
commit 7f6a77da31
5 changed files with 47 additions and 0 deletions

View File

@ -123,6 +123,15 @@ class zulip::common {
},
},
# https://github.com/oliver006/redis_exporter/releases
'redis_exporter' => {
'version' => '1.37.0',
'sha256' => {
'amd64' => 'c4d0554a378151eab3372235c40d3a9c8c40fd6f40d91d768830985df8a44744',
'aarch64' => '742047d938192894979c8370830891bb0fea3262b762e6c51c849a8e47ddfb7e',
},
},
# https://github.com/timonwong/uwsgi_exporter/releases
'uwsgi_exporter' => {
'version' => '1.0.0',

View File

@ -4,6 +4,7 @@ class zulip_ops::profile::chat_zulip_org {
include zulip_ops::profile::base
include zulip_ops::app_frontend_monitoring
include zulip_ops::prometheus::redis
zulip_ops::firewall_allow { 'http': }
zulip_ops::firewall_allow { 'https': }
zulip_ops::firewall_allow { 'smtp': }

View File

@ -1,5 +1,6 @@
class zulip_ops::profile::redis inherits zulip_ops::profile::base {
include zulip::profile::redis
include zulip_ops::prometheus::redis
# Need redis_password in its own file for Nagios
file { '/var/lib/nagios/redis_password':

View File

@ -0,0 +1,28 @@
# @summary Prometheus monitoring of redis servers
#
class zulip_ops::prometheus::redis {
$version = $zulip::common::versions['redis_exporter']['version']
$dir = "/srv/zulip-redis_exporter-${version}"
$bin = "${dir}/redis_exporter"
zulip::external_dep { 'redis_exporter':
version => $version,
url => "https://github.com/oliver006/redis_exporter/releases/download/v${version}/redis_exporter-v${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "redis_exporter-v${version}.linux-${zulip::common::goarch}",
}
zulip_ops::firewall_allow { 'redis_exporter': port => '9121' }
file { "${zulip::common::supervisor_conf_dir}/prometheus_redis_exporter.conf":
ensure => file,
require => [
User[zulip],
Package[supervisor],
Zulip::External_Dep['redis_exporter'],
],
owner => 'root',
group => 'root',
mode => '0644',
content => template('zulip_ops/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb'),
notify => Service[supervisor],
}
}

View File

@ -0,0 +1,8 @@
[program:prometheus_redis_exporter]
command=/usr/local/bin/secret-env-wrapper REDIS_PASSWORD=redis_password <%= @bin %>
priority=10
autostart=true
autorestart=true
user=zulip
redirect_stderr=true
stdout_logfile=/var/log/zulip/redis_exporter.log