Skip to content
Snippets Groups Projects
Commit 01d41cfe authored by Florian Sesser's avatar Florian Sesser
Browse files

Add Prometheus Server

parent 109b59b7
No related branches found
No related tags found
3 merge requests!108Merge staging into production,!107Merge develop into staging,!88Integrate monitoring into local grid
......@@ -38,6 +38,8 @@ import ../../lib/make-grid.nix {
monitoringvpnIPv4 = "172.23.23.1";
inherit vpnClientIPs;
inherit sshUsers;
nodeExporterHostNames = [ ];
nginxExporterHostNames = [ ];
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
} // cfg);
......
......@@ -9,6 +9,8 @@
, stateVersion
, monitoringvpnIPv4
, vpnClientIPs
, nodeExporterHostNames
, nginxExporterHostNames
, ... }: rec {
deployment = {
......@@ -38,6 +40,7 @@
hardware
../../nixos/modules/monitoring/vpn/server.nix
../../nixos/modules/monitoring/server/grafana.nix
../../nixos/modules/monitoring/server/prometheus.nix
];
services.private-storage.monitoring.vpn.server = {
......@@ -52,5 +55,10 @@
lokiUrl = "http://localhost:3100/";
};
services.private-storage.monitoring.prometheus = {
nodeExporterTargets = nodeExporterHostNames;
nginxExporterTargets = nginxExporterHostNames;
};
system.stateVersion = stateVersion;
}
......@@ -24,11 +24,11 @@ in {
};
config = rec {
networking.firewall.allowedTCPPorts = [ services.prometheus.port ];
# networking.firewall.allowedTCPPorts = [ services.prometheus.port ];
services.prometheus = {
enable = true;
port = 9090; # Option only in recent (20.09?) nixpkgs, 9090 default
# port = 9090; # Option only in recent (20.09?) nixpkgs, 9090 default
scrapeConfigs = [
{
job_name = "node-exporters";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment