feat(server/prometheus): add prometheus module and enable it on apollo
This commit is contained in:
parent
d9f2603f4b
commit
887dff6840
2 changed files with 27 additions and 3 deletions
19
modules/nixos/server/monitoring/prometheus/default.nix
Normal file
19
modules/nixos/server/monitoring/prometheus/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue