mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
fix(monitoring): enumerate exporters properly
This commit is contained in:
parent
a1273971d9
commit
452e76e173
2 changed files with 9 additions and 7 deletions
|
|
@ -5,25 +5,25 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (gensokyo-zone) systems;
|
inherit (gensokyo-zone) systems;
|
||||||
inherit (lib.attrsets) filterAttrs mapAttrsToList attrNames;
|
inherit (lib.attrsets) filterAttrs mapAttrsToList;
|
||||||
nodeExporterSystems =
|
nodeExporterSystems =
|
||||||
filterAttrs (
|
filterAttrs (
|
||||||
_: system:
|
_: system:
|
||||||
system.config.exporters.prometheus-exporters-node.enable or false
|
system.config.access.online.enable &&
|
||||||
|
system.config.exports.services.prometheus-exporters-node.enable
|
||||||
)
|
)
|
||||||
systems;
|
systems;
|
||||||
in {
|
in {
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
#enable = true;
|
|
||||||
port = 9090;
|
port = 9090;
|
||||||
scrapeConfigs =
|
scrapeConfigs =
|
||||||
mapAttrsToList (system: systemConfig: {
|
mapAttrsToList (_: system: {
|
||||||
job_name = "${system.config.name}-node-exporter";
|
job_name = "${system.config.name}-node-exporter";
|
||||||
static_configs = {
|
static_configs = [ {
|
||||||
targets = [
|
targets = [
|
||||||
"${access.getAddressFor system.config.name "local"}:${system.config.exporters.prometheus-exporters-node.port}"
|
"${access.getAddressFor system.config.name "local"}:${toString system.config.exports.services.prometheus-exporters-node.ports.default.port}"
|
||||||
];
|
];
|
||||||
};
|
} ];
|
||||||
})
|
})
|
||||||
nodeExporterSystems;
|
nodeExporterSystems;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
in {
|
in {
|
||||||
arch = "x86_64";
|
arch = "x86_64";
|
||||||
type = "NixOS";
|
type = "NixOS";
|
||||||
|
access.online.enable = false;
|
||||||
|
exports.defaultServices = false;
|
||||||
modules = mkForce [
|
modules = mkForce [
|
||||||
./nixos.nix
|
./nixos.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue