From 41706989bbeb0856f2162c702ecaa36026ed2b54 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Tue, 16 Jul 2024 22:59:07 +0530 Subject: [PATCH] rico0: enable prometheus --- hosts/rico0/services/apps/blocky.nix | 4 ++++ hosts/rico0/services/apps/default.nix | 2 +- hosts/rico0/services/apps/prometheus.nix | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 hosts/rico0/services/apps/prometheus.nix diff --git a/hosts/rico0/services/apps/blocky.nix b/hosts/rico0/services/apps/blocky.nix index fbf37ad..44b9775 100644 --- a/hosts/rico0/services/apps/blocky.nix +++ b/hosts/rico0/services/apps/blocky.nix @@ -65,6 +65,10 @@ _: { upstream = "192.168.1.1"; singleNameOrder = [ 2 1 ]; }; + prometheus = { + enable = true; + path = "/metrics"; + }; ports = { dns = "192.168.1.10:53,10.10.10.10:53"; tls = "192.168.1.10:853,10.10.10.10:853"; diff --git a/hosts/rico0/services/apps/default.nix b/hosts/rico0/services/apps/default.nix index 7390f7d..d0d33f0 100644 --- a/hosts/rico0/services/apps/default.nix +++ b/hosts/rico0/services/apps/default.nix @@ -1,3 +1,3 @@ _: { - imports = [ ./blocky.nix ]; + imports = [ ./blocky.nix ./prometheus.nix ]; } diff --git a/hosts/rico0/services/apps/prometheus.nix b/hosts/rico0/services/apps/prometheus.nix new file mode 100644 index 0000000..74d8cf8 --- /dev/null +++ b/hosts/rico0/services/apps/prometheus.nix @@ -0,0 +1,19 @@ +_: { + services.prometheus = { + enable = true; + scrapeConfigs = [ + { + job_name = "frp"; + static_configs = [ + { targets = [ "10.10.10.1:7500" ]; } + ]; + } + { + job_name = "blocky"; + static_configs = [ + { targets = [ "10.10.10.10:8080" ]; } + ]; + } + ]; + }; +}