Filippo Giunchedi has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/373062 )
Change subject: prometheus: add blackbox configuration for prometheus::ops
......................................................................
prometheus: add blackbox configuration for prometheus::ops
Configure basic jobs for blackbox, one for each generic probe configured
at blackbox.yml.
Also add blackbox_exporter itself (the software) to machines running
prometheus::ops. The Prometheus server will talk to blackbox_exporter on
127.0.0.1:9115. It is possible to run blackbox_exporter elsewhere on the
network too, it will complicate the configuration as the job
configuration will need to talk to the site-specific blackbox(es)
instead of 127.0.0.1:9115.
Finally, as first targets for icmp probing, start pinging all bastions
for and from all sites.
Bug: T169860
Change-Id: I34d07db02d37cf1fd259d2defcb7c056e7cff81b
---
M modules/role/manifests/prometheus/ops.pp
1 file changed, 89 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/62/373062/1
diff --git a/modules/role/manifests/prometheus/ops.pp
b/modules/role/manifests/prometheus/ops.pp
index 015c8c3..d2d840d 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -19,6 +19,94 @@
},
}
+ include ::prometheus::blackbox_exporter
+ $blackbox_jobs = [
+ {
+ 'job_name' => 'blackbox_icmp',
+ 'params' => {
+ 'module' => [ 'icmp' ],
+ },
+ 'file_sd_configs' => [
+ { 'files' => [ "${targets_path}/blackbox_icmp_*.yaml" ] }
+ ],
+ 'relabel_configs' => [
+ { 'source_labels' => ['__address__'],
+ 'target_label' => '__param_target',
+ },
+ { 'source_labels' => ['__param_target'],
+ 'target_label' => 'instance',
+ },
+ { 'target_label' => '__address__',
+ 'replacement' => '127.0.0.1:9115',
+ },
+ ],
+ },
+ {
+ 'job_name' => 'blackbox_tcp',
+ 'params' => {
+ 'module' => [ 'tcp_connect' ],
+ },
+ 'file_sd_configs' => [
+ { 'files' => [ "${targets_path}/blackbox_tcp_*.yaml" ] }
+ ],
+ 'relabel_configs' => [
+ { 'source_labels' => ['__address__'],
+ 'target_label' => '__param_target',
+ },
+ { 'source_labels' => ['__param_target'],
+ 'target_label' => 'instance',
+ },
+ { 'target_label' => '__address__',
+ 'replacement' => '127.0.0.1:9115',
+ },
+ ],
+ },
+ {
+ 'job_name' => 'blackbox_http',
+ 'params' => {
+ 'module' => [ 'http_connect' ],
+ },
+ 'file_sd_configs' => [
+ { 'files' => [ "${targets_path}/blackbox_http_*.yaml" ] }
+ ],
+ 'relabel_configs' => [
+ { 'source_labels' => ['__address__'],
+ 'target_label' => '__param_target',
+ },
+ { 'source_labels' => ['__param_target'],
+ 'target_label' => 'instance',
+ },
+ { 'target_label' => '__address__',
+ 'replacement' => '127.0.0.1:9115',
+ },
+ ],
+ },
+ {
+ 'job_name' => 'blackbox_https',
+ 'params' => {
+ 'module' => [ 'https_connect' ],
+ },
+ 'file_sd_configs' => [
+ { 'files' => [ "${targets_path}/blackbox_https_*.yaml" ] }
+ ],
+ 'relabel_configs' => [
+ { 'source_labels' => ['__address__'],
+ 'target_label' => '__param_target',
+ },
+ { 'source_labels' => ['__param_target'],
+ 'target_label' => 'instance',
+ },
+ { 'target_label' => '__address__',
+ 'replacement' => '127.0.0.1:9115',
+ },
+ ],
+ },
+ ]
+
+ # Ping all bastions from all machines running prometheus::ops
+ file { "${targets_path}/blackbox_icmp_bastions.yaml":
+ content => ordered_yaml([{'targets' =>
$::network::constants::special_hosts[$::realm]['bastion_hosts']}]),
+ }
# Add one job for each of mysql 'group' (i.e. their broad function)
# Each job will look for new files matching the glob and load the job
@@ -348,7 +436,7 @@
scrape_configs_extra => array_concat(
$mysql_jobs, $varnish_jobs, $memcached_jobs, $hhvm_jobs,
$apache_jobs, $etcd_jobs, $etcdmirror_jobs, $pdu_jobs,
- $nginx_jobs
+ $nginx_jobs, $blackbox_jobs
),
global_config_extra => $config_extra,
}
--
To view, visit https://gerrit.wikimedia.org/r/373062
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34d07db02d37cf1fd259d2defcb7c056e7cff81b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits