This commit is contained in:
parent
4ed9ba0d24
commit
a90630ecb6
98 changed files with 2063 additions and 729 deletions
|
|
@ -1,9 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
promtail_port = 9080;
|
||||
in
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ promtail_port ];
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
promtail_port = 9080;
|
||||
in {
|
||||
networking.firewall.allowedTCPPorts = [promtail_port];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/promtail 0755 promtail promtail -"
|
||||
|
|
@ -19,26 +21,60 @@ in
|
|||
positions = {
|
||||
filename = "/var/lib/promtail/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
url = "http://monitor.lab:3100/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
path = "/var/log/journal";
|
||||
labels = {
|
||||
job = "promtail";
|
||||
host = config.networking.hostName;
|
||||
env = "proxmox";
|
||||
instance = "${config.networking.hostName}.lab";
|
||||
clients = [
|
||||
{
|
||||
url = "http://monitor.lab:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
path = "/var/log/journal";
|
||||
labels = {
|
||||
job = "promtail";
|
||||
host = config.networking.hostName;
|
||||
env = "proxmox";
|
||||
instance = "${config.networking.hostName}.lab";
|
||||
};
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}];
|
||||
|
||||
}];
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = ["__journal__systemd_unit"];
|
||||
target_label = "unit";
|
||||
}
|
||||
{
|
||||
source_labels = ["__journal__hostname"];
|
||||
target_label = "host";
|
||||
}
|
||||
{
|
||||
source_labels = ["__journal__systemd_user_unit"];
|
||||
target_label = "user_unit";
|
||||
}
|
||||
{
|
||||
source_labels = ["__journal__transport"];
|
||||
target_label = "transport";
|
||||
}
|
||||
{
|
||||
source_labels = ["__journal_priority_keyword"];
|
||||
target_label = "severity";
|
||||
}
|
||||
];
|
||||
}
|
||||
# {
|
||||
# job_name = "secure";
|
||||
# static_configs = {
|
||||
# targets = ["localhost"];
|
||||
# labels = {
|
||||
# job = "secure";
|
||||
# host = config.networking.hostName;
|
||||
# env = "proxmox";
|
||||
# instance = "${config.networking.hostName}.lab";
|
||||
# __path__ = "/var/log/secure";
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue