Add dots.ports module: fleet-wide service port registry (nixnuc + hetznix01)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gene Liverman 2026-05-28 22:42:49 -04:00
parent 84a5c695b0
commit 94fdc678e4
No known key found for this signature in database
15 changed files with 353 additions and 135 deletions

View file

@ -49,9 +49,9 @@ in
static_configs = [
{
targets = [
"127.0.0.1:9100" # nixnuc
"192.168.22.22:9100" # home assistant
"umbrel:9100"
"127.0.0.1:${toString config.dots.ports.node-exporter.port}" # nixnuc
"192.168.22.22:${toString config.dots.ports.node-exporter.port}" # home assistant
"umbrel:${toString config.dots.ports.node-exporter.port}"
];
}
];
@ -89,7 +89,7 @@ in
{
job_name = "cadvisor";
static_configs = [
{ targets = [ "127.0.0.1:8081" ]; }
{ targets = [ "127.0.0.1:${toString config.dots.ports.cadvisor.port}" ]; }
];
metric_relabel_configs = [
{
@ -110,7 +110,7 @@ in
{
job_name = "nginx";
static_configs = [
{ targets = [ "127.0.0.1:9113" ]; }
{ targets = [ "127.0.0.1:${toString config.dots.ports.nginx-exporter.port}" ]; }
];
metric_relabel_configs = [
{
@ -181,7 +181,7 @@ in
};
# Remote write to VictoriaMetrics
remoteWrite.url = "http://127.0.0.1:8428/api/v1/write";
remoteWrite.url = "http://127.0.0.1:${toString config.dots.ports.victoriametrics.port}/api/v1/write";
extraArgs = [
# Pass other remote write flags the module does not expose natively:
@ -219,7 +219,7 @@ in
name = "VictoriaMetrics";
type = "victoriametrics-metrics-datasource";
access = "proxy";
url = "http://127.0.0.1:8428";
url = "http://127.0.0.1:${toString config.dots.ports.victoriametrics.port}";
isDefault = true;
uid = "VictoriaMetrics"; # Set explicit UID for use in alert rules
}
@ -272,7 +272,7 @@ in
server = {
domain = "monitoring.${home_domain}";
http_addr = "0.0.0.0";
http_port = 3002;
http_port = config.dots.ports.grafana.port;
root_url = "https://monitoring.${home_domain}/grafana/";
serve_from_sub_path = true;
};
@ -295,7 +295,7 @@ in
prometheus.exporters.node = {
enable = true;
listenAddress = "127.0.0.1";
port = 9100;
inherit (config.dots.ports.node-exporter) port;
enabledCollectors = [
"zfs"
"systemd"
@ -310,7 +310,7 @@ in
prometheus.exporters.nginx = {
enable = true;
listenAddress = "127.0.0.1";
port = 9113;
inherit (config.dots.ports.nginx-exporter) port;
scrapeUri = "https://127.0.0.1/server_status";
sslVerify = false;
};
@ -319,7 +319,7 @@ in
cadvisor = {
enable = true;
listenAddress = "127.0.0.1";
port = 8081;
inherit (config.dots.ports.cadvisor) port;
extraOptions = [
"--docker_only=true"
"--housekeeping_interval=30s"