strato-infra/nixos/machines/prometheus/default.nix

26 lines
598 B
Nix
Raw Permalink Normal View History

{ config, pkgs, ... }:
let
logSouce = name: target: {
job_name = name;
static_configs = [{ targets = [ target ]; }];
};
in {
imports = [ ../../common ../../common/lxc.nix ];
networking.hostName = "prometheus";
system.stateVersion = "21.11";
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 9001 ];
services.prometheus = {
enable = true;
port = 9001;
scrapeConfigs = [
(logSouce "asraphiel" "asraphiel.dev:9100")
(logSouce "nginx_status_page" "nginx.lxd:9113")
(logSouce "nginx_logs" "nginx.lxd:9117")
];
};
}