From b4e74a39596943aca8c4c5eb656476b0c64cd10f Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Mon, 23 Jan 2023 13:12:46 +0100 Subject: [PATCH] Add node and gogs metrics collection to prometheus --- .../services/metrics/prometheus/default.nix | 3 ++- .../ildkule/services/metrics/prometheus/gogs.nix | 16 ++++++++++++++++ .../ildkule/services/metrics/prometheus/node.nix | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 hosts/ildkule/services/metrics/prometheus/gogs.nix diff --git a/hosts/ildkule/services/metrics/prometheus/default.nix b/hosts/ildkule/services/metrics/prometheus/default.nix index a1315f1..5040e1d 100644 --- a/hosts/ildkule/services/metrics/prometheus/default.nix +++ b/hosts/ildkule/services/metrics/prometheus/default.nix @@ -3,8 +3,9 @@ ./node.nix ./matrix-synapse.nix ./postgres.nix + ./gogs.nix ]; - + services.prometheus = { enable = true; listenAddress = "127.0.0.1"; diff --git a/hosts/ildkule/services/metrics/prometheus/gogs.nix b/hosts/ildkule/services/metrics/prometheus/gogs.nix new file mode 100644 index 0000000..06f52a3 --- /dev/null +++ b/hosts/ildkule/services/metrics/prometheus/gogs.nix @@ -0,0 +1,16 @@ +{ config, ... }: let + cfg = config.services.prometheus; +in { + services.prometheus.scrapeConfigs = [{ + job_name = "git-gogs"; + scheme = "https"; + metrics_path = "/-/metrics"; + static_configs = [ + { + targets = [ + "essendrop.pvv.ntnu.no:443" + ]; + } + ]; + }]; +} diff --git a/hosts/ildkule/services/metrics/prometheus/node.nix b/hosts/ildkule/services/metrics/prometheus/node.nix index 23a1969..c4e8a34 100644 --- a/hosts/ildkule/services/metrics/prometheus/node.nix +++ b/hosts/ildkule/services/metrics/prometheus/node.nix @@ -13,6 +13,7 @@ in { "hildring.pvv.ntnu.no:9100" "bicep.pvv.ntnu.no:9100" "jokum.pvv.ntnu.no:9100" + "essendrop.pvv.ntnu.no:9100" ]; } ];