monitoring: add nixos-exporter to monitoring01
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Enable the nixos-exporter prometheus exporter with flake collector to track NixOS generation metrics and flake revision status. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
21
flake.lock
generated
21
flake.lock
generated
@@ -42,6 +42,26 @@
|
||||
"url": "https://git.t-juice.club/torjus/labmon"
|
||||
}
|
||||
},
|
||||
"nixos-exporter": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770415085,
|
||||
"narHash": "sha256-8XhzLc9wIoxL/OwKmX9LxpYCbmz3iMuuAX/4ILnw2TQ=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "858e047bff6224c90ff5d033f8adbbba01036029",
|
||||
"revCount": 2,
|
||||
"type": "git",
|
||||
"url": "https://git.t-juice.club/torjus/nixos-exporter"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.t-juice.club/torjus/nixos-exporter"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1770136044,
|
||||
@@ -78,6 +98,7 @@
|
||||
"inputs": {
|
||||
"alerttonotify": "alerttonotify",
|
||||
"labmon": "labmon",
|
||||
"nixos-exporter": "nixos-exporter",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"sops-nix": "sops-nix"
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
url = "git+https://git.t-juice.club/torjus/labmon?ref=master";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
nixos-exporter = {
|
||||
url = "git+https://git.t-juice.club/torjus/nixos-exporter";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -27,6 +31,7 @@
|
||||
sops-nix,
|
||||
alerttonotify,
|
||||
labmon,
|
||||
nixos-exporter,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
@@ -180,6 +185,7 @@
|
||||
./hosts/monitoring01
|
||||
sops-nix.nixosModules.sops
|
||||
labmon.nixosModules.labmon
|
||||
nixos-exporter.nixosModules.default
|
||||
];
|
||||
};
|
||||
jelly01 = nixpkgs.lib.nixosSystem {
|
||||
|
||||
@@ -99,6 +99,23 @@
|
||||
];
|
||||
};
|
||||
|
||||
# NixOS metrics exporter
|
||||
services.prometheus.exporters.nixos = {
|
||||
enable = true;
|
||||
flake = {
|
||||
enable = true;
|
||||
url = "git+https://git.t-juice.club/torjus/nixos-servers.git";
|
||||
};
|
||||
};
|
||||
|
||||
# Register nixos-exporter as a Prometheus scrape target
|
||||
homelab.monitoring.scrapeTargets = [
|
||||
{
|
||||
job_name = "nixos-exporter";
|
||||
port = 9971;
|
||||
}
|
||||
];
|
||||
|
||||
labmon = {
|
||||
enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user