2020-07-23 23:23:43 +02:00
|
|
|
# @summary Gathers Prometheus statistics from all nodes.
|
|
|
|
#
|
|
|
|
# Only one instance is necessary.
|
|
|
|
#
|
|
|
|
class zulip_ops::profile::prometheus_server {
|
|
|
|
include zulip_ops::profile::base
|
|
|
|
include zulip_ops::prometheus::base
|
|
|
|
|
|
|
|
$version = '2.27.1'
|
|
|
|
zulip::sha256_tarball_to { 'prometheus':
|
2021-12-06 18:43:29 +01:00
|
|
|
url => "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${::architecture}.tar.gz",
|
2020-07-23 23:23:43 +02:00
|
|
|
sha256 => 'ce637d0167d5e6d2561f3bd37e1c58fe8601e13e4e1ea745653c068f6e1317ae',
|
|
|
|
install => {
|
2021-12-06 18:43:29 +01:00
|
|
|
"prometheus-${version}.linux-${::architecture}/" => "/srv/prometheus-${version}/",
|
2020-07-23 23:23:43 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
file { '/srv/prometheus':
|
|
|
|
ensure => 'link',
|
|
|
|
target => "/srv/prometheus-${version}/",
|
|
|
|
require => Zulip::Sha256_tarball_to['prometheus'],
|
|
|
|
}
|
|
|
|
file { '/usr/local/bin/promtool':
|
|
|
|
ensure => 'link',
|
|
|
|
target => '/srv/prometheus/promtool',
|
|
|
|
require => File['/srv/prometheus'],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/var/lib/prometheus':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'prometheus',
|
|
|
|
group => 'prometheus',
|
|
|
|
require => [ User[prometheus], Group[prometheus] ],
|
|
|
|
}
|
2021-06-11 22:37:36 +02:00
|
|
|
file { "${zulip::common::supervisor_conf_dir}/prometheus.conf":
|
2020-07-23 23:23:43 +02:00
|
|
|
ensure => file,
|
|
|
|
require => [
|
|
|
|
Package[supervisor],
|
|
|
|
File['/srv/prometheus'],
|
|
|
|
File['/var/lib/prometheus'],
|
|
|
|
],
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/supervisor/conf.d/prometheus.conf',
|
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/prometheus':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
}
|
|
|
|
file { '/etc/prometheus/prometheus.yaml':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/prometheus/prometheus.yaml',
|
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
}
|