feat: create exporters module (#364)

- upgrade node_exporter, bring managed under exporters module
- upgrade postgres_exporter, bring managed under exporters module
- add flag to cleanup previous iterations of exporters from prometheus module
- fix issues with vmclusster: replication + dedup

Reviewed-on: #364
This commit was merged in pull request #364.
This commit is contained in:
2025-07-27 13:28:41 +10:00
parent 0e64c9855a
commit fd902c1437
15 changed files with 236 additions and 21 deletions
-1
View File
@@ -37,7 +37,6 @@ class profiles::base (
include profiles::ssh::knownhosts
include profiles::ssh::service
include profiles::cloudinit::init
include profiles::metrics::default
include profiles::helpers::node_lookup
include profiles::consul::client
@@ -1,11 +0,0 @@
# profiles::metrics::default
#
# these exporters will be setup on all nodes
class profiles::metrics::default (
Boolean $node_exporter = true,
Boolean $systemd_exporter = false,
) {
if $node_exporter { include prometheus::node_exporter }
if $systemd_exporter { include prometheus::systemd_exporter }
}
+5 -5
View File
@@ -84,11 +84,11 @@ class profiles::sql::patroni (
}
if $postgres_exporter_enabled {
class { 'prometheus::postgres_exporter':
postgres_user => $postgres_exporter_user,
postgres_pass => $postgres_exporter_pass,
data_source_uri => "${facts['networking']['ip']}:5432/postgres?sslmode=disable",
export_scrape_job => true,
class { 'exporters::postgres_exporter':
db_user => $postgres_exporter_user,
db_pass => $postgres_exporter_pass,
cleanup_old_postgres_exporter => true,
enable => true,
}
}
}