diff options
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/atlas/default.nix | 1 | ||||
| -rw-r--r-- | hosts/atlas/prometheus.nix | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/hosts/atlas/default.nix b/hosts/atlas/default.nix index 6380d14..50fa986 100644 --- a/hosts/atlas/default.nix +++ b/hosts/atlas/default.nix @@ -5,6 +5,7 @@ }: { imports = [ ./hardware-configuration.nix + ./prometheus.nix ]; _module.args.nixinate = { diff --git a/hosts/atlas/prometheus.nix b/hosts/atlas/prometheus.nix new file mode 100644 index 0000000..b0c3f7b --- /dev/null +++ b/hosts/atlas/prometheus.nix @@ -0,0 +1,33 @@ +{config, ...}: let + scrapeExporter = name: host: port: { + job_name = "${name}"; + static_configs = [ + { + targets = [ + "${host}:${port}" + ]; + } + ]; + }; +in { + services.prometheus = { + enable = true; + port = 5000; + exporters = { + node = { + enable = true; + enabledCollectors = ["systemd"]; + port = 5001; + }; + }; + scrapeConfigs = [ + (scrapeExporter "atlas" "127.0.0.1" "${toString config.services.prometheus.exporters.node.port}") + ]; + }; + + getchoo.server.services.promtail.clients = [ + { + url = "p-body:3030/loki/api/v1/push"; + } + ]; +} |
