2024-02-28 22:49:27 +01:00
|
|
|
{ config, ... }:
|
|
|
|
{
|
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
2024-02-29 14:21:15 +01:00
|
|
|
globalConfig = {
|
|
|
|
scrape_interval = "15s";
|
|
|
|
};
|
|
|
|
# Only check the configuration syntax, because the check is run during the build phase
|
|
|
|
# and secrets are not accessible to the build environment
|
|
|
|
checkConfig = "syntax-only";
|
2024-02-28 22:49:27 +01:00
|
|
|
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "saga";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = [
|
|
|
|
"saga:${toString config.services.prometheus.exporters.node.port}" # node
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
job_name = "valkyrie";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = [
|
|
|
|
"valkyrie:${toString config.services.prometheus.exporters.node.port}" # node
|
|
|
|
"valkyrie:${toString config.services.prometheus.exporters.unbound.port}" # unbound
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2024-02-29 14:21:15 +01:00
|
|
|
{
|
|
|
|
job_name = "incus";
|
|
|
|
metrics_path = "/1.0/metrics";
|
|
|
|
scheme = "https";
|
|
|
|
tls_config = {
|
|
|
|
ca_file = config.sops.secrets.metrics_ca.path;
|
|
|
|
cert_file = config.sops.secrets.metrics_cert.path;
|
|
|
|
key_file = config.sops.secrets.metrics_key.path;
|
|
|
|
};
|
|
|
|
static_configs = [ { targets = [ "odin:8443" ]; } ];
|
|
|
|
}
|
2024-02-28 22:49:27 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|