aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-12-26 11:24:44 +0100
committerMartin Fischer <martin@push-f.com>2025-12-26 11:25:08 +0100
commit3498b31257e07876d5442cb15ed35ed822aea4fa (patch)
tree2dcdb5eef86e9856c103f485a7ac0aaff89a1217 /nixos
parent3e451552935ab46d9bac7fc13cd20503e5482cbd (diff)
refactor: define prometheusScrapeConfigs in main modules
Diffstat (limited to 'nixos')
-rw-r--r--nixos/hosts/ev/default.nix8
-rw-r--r--nixos/hosts/ev/exporters.nix9
-rw-r--r--nixos/hosts/tente/default.nix14
-rw-r--r--nixos/hosts/tente/exporters.nix15
4 files changed, 22 insertions, 24 deletions
diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix
index c5abe4d..5d6de93 100644
--- a/nixos/hosts/ev/default.nix
+++ b/nixos/hosts/ev/default.nix
@@ -164,6 +164,14 @@ in
lokiPort = ports.grafanaLoki;
prometheusPort = ports.prometheus;
prometheusNodeExporterPort = ports.prometheusNodeExporter;
+ prometheusScrapeConfigs = [
+ {
+ job_name = "sql";
+ static_configs = [{
+ targets = ["localhost:${toString ports.prometheusSqlExporter}"];
+ }];
+ }
+ ];
};
# Backups
diff --git a/nixos/hosts/ev/exporters.nix b/nixos/hosts/ev/exporters.nix
index 1c03c35..097e3e5 100644
--- a/nixos/hosts/ev/exporters.nix
+++ b/nixos/hosts/ev/exporters.nix
@@ -29,14 +29,5 @@ in
collectors = helpers.collectors;
};
};
-
- monitoring.prometheusScrapeConfigs = [
- {
- job_name = "sql";
- static_configs = [{
- targets = [ "localhost:${toString cfg.sqlExporterPort}" ];
- }];
- }
- ];
};
}
diff --git a/nixos/hosts/tente/default.nix b/nixos/hosts/tente/default.nix
index cc97830..749f468 100644
--- a/nixos/hosts/tente/default.nix
+++ b/nixos/hosts/tente/default.nix
@@ -249,6 +249,20 @@ in
];
prometheusPort = ports.prometheus;
prometheusNodeExporterPort = ports.prometheusNodeExporter;
+ prometheusScrapeConfigs = [
+ {
+ job_name = "sql";
+ static_configs = [{
+ targets = ["localhost:${toString ports.prometheusSqlExporter}"];
+ }];
+ }
+ {
+ job_name = "storagebox";
+ static_configs = [{
+ targets = ["localhost:${toString ports.prometheusStorageboxExporter}"];
+ }];
+ }
+ ];
};
# Backups
diff --git a/nixos/hosts/tente/exporters.nix b/nixos/hosts/tente/exporters.nix
index eb46015..3a587e0 100644
--- a/nixos/hosts/tente/exporters.nix
+++ b/nixos/hosts/tente/exporters.nix
@@ -41,20 +41,5 @@ in
port = cfg.storageboxExporterPort;
hetznerTokenFile = config.age.secrets.hetzner-token.path;
};
-
- monitoring.prometheusScrapeConfigs = [
- {
- job_name = "sql";
- static_configs = [{
- targets = [ "localhost:${toString cfg.sqlExporterPort}" ];
- }];
- }
- {
- job_name = "storagebox";
- static_configs = [{
- targets = [ "localhost:${toString cfg.storageboxExporterPort}" ];
- }];
- }
- ];
};
}