home lab init
This commit is contained in:
commit
7278922625
65 changed files with 27336 additions and 0 deletions
27
nixos/hosts/traefik/promtail.nix
Normal file
27
nixos/hosts/traefik/promtail.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
# This ensures the directory exists at boot, owned by traefik (writer) and readable by promtail.
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/log/traefik 0755 traefik promtail -"
|
||||
];
|
||||
|
||||
services.promtail.configuration.scrape_configs = lib.mkAfter [
|
||||
{
|
||||
job_name = "traefik";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "localhost" ];
|
||||
labels = {
|
||||
job = "traefik";
|
||||
host = config.networking.hostName;
|
||||
env = "proxmox";
|
||||
instance = "${config.networking.hostName}.local"; # prometheus scrape target
|
||||
__path__ = "/var/log/traefik/*.log";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue