Files
zulip/puppet/zulip_ops/manifests/prometheus/wal_g.pp
Alex Vandiver 3aba2789d3 prometheus: Add an exporter for wal-g backup properties.
Since backups may now taken on arbitrary hosts, we need a blackbox
monitor that _some_ backup was produced.

Add a Prometheus exporter which calls `wal-g backup-list` and reports
statistics about the backups.

This could be extended to include `wal-g wal-verify`, but that
requires a connection to the PostgreSQL server.
2023-04-26 15:41:39 -07:00

35 lines
1.1 KiB
Puppet

# @summary Prometheus monitoring of wal-g backups
#
class zulip_ops::prometheus::wal_g {
include zulip_ops::prometheus::base
include zulip::supervisor
include zulip::wal_g
file { '/usr/local/bin/wal-g-exporter':
ensure => file,
require => User[zulip],
owner => 'zulip',
group => 'zulip',
mode => '0755',
source => 'puppet:///modules/zulip/postgresql/wal-g-exporter',
}
# We embed the hash of the contents into the name of the process, so
# that `supervisorctl reread` knows that it has updated.
$full_exporter_hash = sha256(file('zulip/postgresql/wal-g-exporter'))
$exporter_hash = $full_exporter_hash[0,8]
file { "${zulip::common::supervisor_conf_dir}/prometheus_wal_g_exporter.conf":
ensure => file,
require => [
User[zulip],
Package[supervisor],
File['/usr/local/bin/wal-g-exporter'],
],
owner => 'root',
group => 'root',
mode => '0644',
content => template('zulip_ops/supervisor/conf.d/prometheus_wal_g_exporter.conf.template.erb'),
notify => Service[supervisor],
}
}