From cc31b57fcb9050f4b5668c906380f166d0a6a716 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Sat, 27 Apr 2024 12:09:45 +0200 Subject: [PATCH] Add metrics endpoint and scrape config --- nixos/hosts/devbox/matrix-synapse/default.nix | 5 +++++ nixos/hosts/devbox/monitoring/default.nix | 20 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/nixos/hosts/devbox/matrix-synapse/default.nix b/nixos/hosts/devbox/matrix-synapse/default.nix index 68f5c07..b2ca20c 100644 --- a/nixos/hosts/devbox/matrix-synapse/default.nix +++ b/nixos/hosts/devbox/matrix-synapse/default.nix @@ -48,6 +48,11 @@ compress = true; }]; } + { + port = 9002; + type = "metrics"; + bind_addresses = ["127.0.0.1"]; + } ]; database.name = "sqlite3"; diff --git a/nixos/hosts/devbox/monitoring/default.nix b/nixos/hosts/devbox/monitoring/default.nix index b566ea6..2d29501 100644 --- a/nixos/hosts/devbox/monitoring/default.nix +++ b/nixos/hosts/devbox/monitoring/default.nix @@ -8,12 +8,20 @@ prometheus = { enable = true; stateDir = "prometheus"; - scrapeConfigs =[{ - job_name = "steam-servers"; - static_configs = [{ - targets = [ "steam-servers.dev.albinvass.se:9002" ]; - }]; - }]; + scrapeConfigs =[ + { + job_name = "steam-servers"; + static_configs = [{ + targets = [ "steam-servers.dev.albinvass.se:9002" ]; + }]; + } + { + job_name = "matrix-synapse"; + static_configs = [{ + targets = [ "localhost:9002" ]; + }]; + } + ]; }; grafana = { enable = true;