From 15c5591c6e57031b6cd8ce85cbb3a38c9cdfa23d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 24 Apr 2022 14:01:01 -0700 Subject: gitea: enable metric endpoint Move configuration for the scraper into the gitea module itself. --- modules/services/gitea/default.nix | 14 +++++++++++++- modules/services/prometheus/default.nix | 6 ------ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/services/gitea/default.nix b/modules/services/gitea/default.nix index 6259c30..e5a3db7 100644 --- a/modules/services/gitea/default.nix +++ b/modules/services/gitea/default.nix @@ -29,7 +29,11 @@ in { httpAddress = "127.0.0.1"; httpPort = 8002; log.level = "Error"; - settings = { other.SHOW_FOOTER_VERSION = false; }; + settings = { + other.SHOW_FOOTER_VERSION = false; + metrics.ENABLED = true; + metrics.ENABLED_ISSUE_BY_REPOSITORY = true; + }; dump.enable = false; database = { type = "sqlite3"; @@ -46,6 +50,14 @@ in { }; }; + services.prometheus.scrapeConfigs = [{ + job_name = "gitea"; + metrics_path = "/metrics"; + scheme = "https"; + scrape_interval = "30s"; + static_configs = [{ targets = [ "git.fcuny.net" ]; }]; + }]; + my.services.backup = { paths = [ cfg.stateDir ]; }; }; } diff --git a/modules/services/prometheus/default.nix b/modules/services/prometheus/default.nix index 37cbbac..0c66f47 100644 --- a/modules/services/prometheus/default.nix +++ b/modules/services/prometheus/default.nix @@ -131,12 +131,6 @@ in { static_configs = [{ targets = [ "192.168.6.20:9090" ]; }]; relabel_configs = relabelConfigs; } - { - job_name = "gitea"; - static_configs = [{ targets = [ "192.168.6.20:8002" ]; }]; - relabel_configs = relabelConfigs; - } - { job_name = "dnsd"; static_configs = [{ targets = [ "192.168.6.1:8053" ]; }]; -- cgit 1.4.1