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 { ...@@ -38,6 +38,8 @@ import ../../lib/make-grid.nix {
monitoringvpnIPv4 = "172.23.23.1"; monitoringvpnIPv4 = "172.23.23.1";
inherit vpnClientIPs; inherit vpnClientIPs;
inherit sshUsers; inherit sshUsers;
nodeExporterHostNames = [ ];
nginxExporterHostNames = [ ];
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; }); hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09"; stateVersion = "19.09";
} // cfg); } // cfg);
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
, stateVersion , stateVersion
, monitoringvpnIPv4 , monitoringvpnIPv4
, vpnClientIPs , vpnClientIPs
, nodeExporterHostNames
, nginxExporterHostNames
, ... }: rec { , ... }: rec {
deployment = { deployment = {
...@@ -38,6 +40,7 @@ ...@@ -38,6 +40,7 @@
hardware hardware
../../nixos/modules/monitoring/vpn/server.nix ../../nixos/modules/monitoring/vpn/server.nix
../../nixos/modules/monitoring/server/grafana.nix ../../nixos/modules/monitoring/server/grafana.nix
../../nixos/modules/monitoring/server/prometheus.nix
]; ];
services.private-storage.monitoring.vpn.server = { services.private-storage.monitoring.vpn.server = {
...@@ -52,5 +55,10 @@ ...@@ -52,5 +55,10 @@
lokiUrl = "http://localhost:3100/"; lokiUrl = "http://localhost:3100/";
}; };
services.private-storage.monitoring.prometheus = {
nodeExporterTargets = nodeExporterHostNames;
nginxExporterTargets = nginxExporterHostNames;
};
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
} }
...@@ -24,11 +24,11 @@ in { ...@@ -24,11 +24,11 @@ in {
}; };
config = rec { config = rec {
networking.firewall.allowedTCPPorts = [ services.prometheus.port ]; # networking.firewall.allowedTCPPorts = [ services.prometheus.port ];
services.prometheus = { services.prometheus = {
enable = true; 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 = [ scrapeConfigs = [
{ {
job_name = "node-exporters"; 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