feat(server/prometheus): add prometheus module and enable it on apollo

This commit is contained in:
Mohammad Rafiq 2025-06-13 05:54:46 +08:00
parent d9f2603f4b
commit 887dff6840
No known key found for this signature in database
2 changed files with 27 additions and 3 deletions

View file

@ -0,0 +1,19 @@
{ config, lib, ... }:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.pantheon) mkPortOption;
cfg = config.server.monitoring.prometheus;
in
{
options.server.monitoring.prometheus = {
enable = mkEnableOption "";
port = mkPortOption 9090;
};
config = mkIf cfg.enable {
services.prometheus = {
enable = true;
inherit (cfg) port;
};
};
}

View file

@ -20,9 +20,14 @@
};
server = {
monitoring.grafana = {
enable = true;
url = "grafana.bwfiq.com";
monitoring = {
prometheus = {
enable = true;
};
grafana = {
enable = true;
url = "grafana.bwfiq.com";
};
};
networking.ddns = {
enable = true;