Files
upstream-zulip/puppet/kandra/manifests/profile/prometheus_server.pp
upstream-mirror 64898b2c79
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
2026-09-15 15:05:30 +05:00

88 lines
2.5 KiB
Puppet

# @summary Gathers Prometheus statistics from all nodes.
#
# Only one instance is necessary.
#
class kandra::profile::prometheus_server inherits kandra::profile::base {
include kandra::prometheus::base
# Service discovery via Teleport
include kandra::teleport::tbot
include kandra::teleport::sd
# This blackbox monitoring of the backup system runs locally
include kandra::prometheus::wal_g
# Ditto the Akamai logs
include kandra::prometheus::akamai
# Ditto Weblate
include kandra::prometheus::weblate
# The SES log ETL (writing to S3) runs on vector
include kandra::ses_logs
# Export prometheus stats to status.zulip.com
include kandra::statuspage
$version = $zulip::common::versions['prometheus']['version']
$dir = "/srv/zulip-prometheus-${version}"
$bin = "${dir}/prometheus"
$data_dir = '/var/lib/prometheus'
zulip::external_dep { 'prometheus':
version => $version,
url => "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${zulip::common::goarch}.tar.gz",
tarball_prefix => "prometheus-${version}.linux-${zulip::common::goarch}",
bin => [$bin, "${dir}/promtool"],
cleanup_after => [Service[supervisor]],
}
file { '/usr/local/bin/promtool':
ensure => link,
target => "${dir}/promtool",
require => File["${dir}/promtool"],
before => Exec['Cleanup prometheus'],
}
file { $data_dir:
ensure => directory,
owner => 'prometheus',
group => 'prometheus',
require => [ User[prometheus], Group[prometheus] ],
}
file { '/etc/prometheus':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
$czo = zulipconf('prometheus', 'czo', '')
$other_hosts = split(zulipconf('prometheus', 'other_hosts', ''), ',')
$backup_buckets = split(zulipconf('prometheus', 'walg_buckets', ''), ',')
file { '/etc/prometheus/prometheus.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => template('kandra/prometheus/prometheus.yaml.template.erb'),
notify => Service[supervisor],
}
file { "${zulip::common::supervisor_conf_dir}/prometheus.conf":
ensure => file,
require => [
Package[supervisor],
File[$bin],
File[$data_dir],
File['/etc/prometheus/prometheus.yaml'],
Service['tbot'],
],
owner => 'root',
group => 'root',
mode => '0644',
content => template('kandra/supervisor/conf.d/prometheus.conf.template.erb'),
notify => Service[supervisor],
}
}