aboutsummaryrefslogtreecommitdiff
path: root/tharos/prometheus.nix
diff options
context:
space:
mode:
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";
+ };
+ };
+}