aboutsummaryrefslogtreecommitdiff
path: root/tharos/prometheus.nix
diff options
context:
space:
mode:
authorValentin <valentin@fricklerhandwerk.de>2025-11-20 16:37:05 +0100
committerValentin <valentin@fricklerhandwerk.de>2025-11-20 16:37:05 +0100
commitbf1b4656a84f700c70132d32d374a90f1e223b56 (patch)
tree2393471b7d19ecb2903b27c246841d151c2505ee /tharos/prometheus.nix
parentca0d1b6cd01b2d53b6b3959ce2c6ce648804213e (diff)
parentf0552cc217f949403d2e3285d89150373941feff (diff)
Merge branch 'grafana'
Systemüberwachung eingerichtet
Diffstat (limited to 'tharos/prometheus.nix')
-rw-r--r--tharos/prometheus.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/tharos/prometheus.nix b/tharos/prometheus.nix
new file mode 100644
index 0000000..48d7a85
--- /dev/null
+++ b/tharos/prometheus.nix
@@ -0,0 +1,34 @@
+{ self, lib, ... }:
+{
+ flake.machines.tharos = {
+ nixos =
+ { config, ... }:
+ {
+ services.prometheus = {
+ enable = true;
+ exporters.node = {
+ enable = true;
+ openFirewall = true;
+ enabledCollectors = [ ];
+ };
+ globalConfig.scrape_interval = "10s";
+ scrapeConfigs = [
+ {
+ job_name = "node";
+ static_configs = [
+ {
+ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
+ }
+ ];
+ }
+ ];
+ };
+ };
+
+ vm =
+ { ... }:
+ {
+ services.prometheus.globalConfig.scrape_interval = lib.mkForce "5s";
+ };
+ };
+}