diff options
author | sinanmohd <sinan@sinanmohd.com> | 2025-03-16 17:47:50 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2025-03-17 00:32:02 +0530 |
commit | cf9392703c0ce468a4eb41295c01b0b491ce4de1 (patch) | |
tree | 8589b80a0c8de785f7f5f0cfb239464737777750 | |
parent | 1b39ffd12dcb24142327a2bd62c1587599915980 (diff) |
kay/observability/prometheus: init
-rw-r--r-- | os/kay/modules/observability/default.nix | 5 | ||||
-rw-r--r-- | os/kay/modules/observability/prometheus.nix | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/os/kay/modules/observability/default.nix b/os/kay/modules/observability/default.nix index ff848b8..d93681b 100644 --- a/os/kay/modules/observability/default.nix +++ b/os/kay/modules/observability/default.nix @@ -1,4 +1,7 @@ { ... }: { - imports = [ ./grafana.nix ]; + imports = [ + ./grafana.nix + ./prometheus.nix + ]; } diff --git a/os/kay/modules/observability/prometheus.nix b/os/kay/modules/observability/prometheus.nix new file mode 100644 index 0000000..ac94ba9 --- /dev/null +++ b/os/kay/modules/observability/prometheus.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + services.prometheus = { + enable = true; + port = 9001; + + scrapeConfigs = [ + { + job_name = "kay"; + static_configs = [ + { + targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ]; + } + ]; + } + ]; + + exporters = { + node = { + enable = true; + enabledCollectors = [ "systemd" ]; + port = 9002; + }; + }; + }; +} |