diff options
| author | seth <[email protected]> | 2023-05-19 11:19:55 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-19 11:19:55 -0400 |
| commit | 8e5ce33b09eafb2b477d7b10f7a745b6189e0464 (patch) | |
| tree | 033108059b9d263d0e8d8df7d3e0e58199eb12be /hosts/p-body/prometheus.nix | |
| parent | 44fef05d2e39060a32b61c0e2346b45803cddc77 (diff) | |
p-body: add grafana, loki, and prometheus
Diffstat (limited to 'hosts/p-body/prometheus.nix')
| -rw-r--r-- | hosts/p-body/prometheus.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hosts/p-body/prometheus.nix b/hosts/p-body/prometheus.nix new file mode 100644 index 0000000..a0d272d --- /dev/null +++ b/hosts/p-body/prometheus.nix @@ -0,0 +1,27 @@ +{config, ...}: let + scrapeExporter = name: exporter: { + job_name = "${name}"; + static_configs = [ + { + targets = [ + "127.0.0.1:${toString config.services.prometheus.exporters.${exporter}.port}" + ]; + } + ]; + }; +in { + services.prometheus = { + enable = true; + port = 5000; + exporters = { + node = { + enable = true; + enabledCollectors = ["systemd"]; + port = 5001; + }; + }; + scrapeConfigs = [ + (scrapeExporter "p-body" "node") + ]; + }; +} |
