modules/monitoring: clean up tailscale and caddy config

This commit is contained in:
xinyangli 2024-12-05 17:36:01 +08:00
parent 756357552a
commit 9a21ab6621
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
10 changed files with 109 additions and 47 deletions

View file

@ -28,17 +28,21 @@ in
)
);
mkCaddyScrapes = mkFunction (
mkCaddyScrapes = targets: [
{
address,
port ? 2019,
...
}:
{
job_name = "caddy_${address}";
static_configs = [ { targets = [ "${address}${mkPort port}" ]; } ];
job_name = "caddy";
scheme = "https";
static_configs = map (
{
address,
port ? 2019,
}:
{
targets = [ "${address}${mkPort port}" ];
}
) targets;
}
);
];
mkCaddyRules = mkFunction (
{
@ -63,17 +67,20 @@ in
}
);
mkNodeScrapes = mkFunction (
mkNodeScrapes = targets: [
{
address,
port ? 9100,
...
}:
{
job_name = "node_${address}";
static_configs = [ { targets = [ "${address}${mkPort port}" ]; } ];
job_name = "node_exporter";
static_configs = map (
{
address,
port ? 9100,
}:
{
targets = [ "${address}${mkPort port}" ];
}
) targets;
}
);
];
mkNodeRules = mkFunction (
{

View file

@ -12,5 +12,9 @@
grafanaUrl = "https://grafana.xiny.li";
synapseUrl = "https://xiny.li";
synapseDelegateUrl = "https://synapse.xiny.li";
prometheusCollectors = [
"thorite.coho-tet.ts.net"
];
};
}