mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-19 19:30:28 +05:00
feat: add prometheus
This commit is contained in:
parent
2e511cc4de
commit
8215ffde8a
|
@ -28,6 +28,7 @@
|
||||||
./programs/yggdrasil.nix
|
./programs/yggdrasil.nix
|
||||||
|
|
||||||
./programs/grafana.nix
|
./programs/grafana.nix
|
||||||
|
./programs/prometheus.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."grafana.comfycamp.space" = {
|
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
||||||
useACMEHost = "comfycamp.space";
|
useACMEHost = "comfycamp.space";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:55010";
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
23
nixos/programs/prometheus.nix
Normal file
23
nixos/programs/prometheus.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 55011;
|
||||||
|
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
port = 55012;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "node";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue