Files
zulip/puppet/kandra/manifests/prometheus/pushgateway.pp
Alex Vandiver 25d156cc9c prometheus: Add a pushgateway.
Prometheus declares metrics to be "stale" if they go 5min without an
update[^1], and removes them -- which makes longer scrape intervals
impossible.

Add a pushgateway, which caches output from such jobs.

[^1]: https://prometheus.io/docs/prometheus/latest/querying/basics/#staleness
2025-10-22 11:57:02 -07:00

33 lines
1.0 KiB
Puppet

# @summary Pushgateway for cron jobs
#
class kandra::prometheus::pushgateway {
include kandra::prometheus::base
include zulip::supervisor
$version = $zulip::common::versions['pushgateway']['version']
$dir = "/srv/zulip-pushgateway-${version}"
$bin = "${dir}/pushgateway"
zulip::external_dep { 'pushgateway':
version => $version,
url => "https://github.com/prometheus/pushgateway/releases/download/v${version}/pushgateway-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "pushgateway-${version}.linux-${zulip::common::goarch}",
bin => [$bin],
cleanup_after => [Service[supervisor]],
}
file { "${zulip::common::supervisor_conf_dir}/prometheus_pushgateway.conf":
ensure => file,
require => [
User[zulip],
Package[supervisor],
File[$bin],
],
owner => 'root',
group => 'root',
mode => '0644',
content => template('kandra/supervisor/conf.d/prometheus_pushgateway.conf.template.erb'),
notify => Service[supervisor],
}
}