📊 prometheus setup

This commit is contained in:
James Walker 2021-05-10 21:42:30 -04:00
parent 6fda2af072
commit 4fb6c04299
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 60 additions and 4 deletions

View File

@ -32,7 +32,23 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
];
services.tailscale.enable = true;
environment.systemPackages = with pkgs; [ libraspberrypi ];
services = {
prometheus = {
enable = true;
port = 9090;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
openFirewall = true;
port = 9100;
};
};
};
tailscale = { enable = true; };
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View File

@ -76,6 +76,45 @@
# Or disable the firewall altogether.
networking.firewall.enable = false;
services = {
grafana = {
enable = true;
domain = "plato.walkah.lab";
port = 2342;
addr = "0.0.0.0";
};
prometheus = {
enable = true;
port = 9090;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9100;
};
};
scrapeConfigs = [
{
job_name = "node";
static_configs = [{
targets = [
"plato:9100"
"agent:9100"
"form:9100"
"matter:9100"
"purpose:9100"
];
}];
}
{
job_name = "coredns";
static_configs = [{ targets = [ "plato:9153" ]; }];
}
];
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

View File

@ -9,6 +9,7 @@
errors
cache
dnssec
prometheus 0.0.0.0:9153
forward . tls://1.1.1.1 tls://1.0.0.1 {
tls_servername cloudflare-dns.com
}

View File

@ -17,10 +17,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "55fafd9e23aa3e674a8db89013a004512ec5d2a9",
"sha256": "02vy0544zvh7j6azmg35az0za55m2pyczb2361w0awriz2ckbpav",
"rev": "1c16013bd6e94da748b41cc123c6b509a23eb440",
"sha256": "1m2wif0qnci0q14plbqlb95vx214pxqgw5li86lyw6hsiy7y3zfn",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/55fafd9e23aa3e674a8db89013a004512ec5d2a9.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/1c16013bd6e94da748b41cc123c6b509a23eb440.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}