better logging

This commit is contained in:
chris 2025-03-15 01:38:57 +01:00
parent e7d531760d
commit 752ac44a52
Signed by: c6ristian
SSH key fingerprint: SHA256:B3m+yzpaxGXSEcDBpPHfvza/DNC0wuX+CKMeGq8wgak
2 changed files with 9 additions and 1 deletions
modules
systems/monitoring.noc.eh22.intern

View file

@ -58,7 +58,7 @@
}
rule {
source_labels = ["__journal__hostname"]
target_label = "systemd_hostname"
target_label = "instance"
}
rule {
source_labels = ["__journal__transport"]
@ -68,11 +68,16 @@
source_labels = ["__journal_syslog_identifier"]
target_label = "syslog_identifier"
}
rule {
source_labels = ["__journal_priority_keyword"]
target_label = "level"
}
}
loki.source.journal "read_journal" {
forward_to = [loki.write.default.receiver]
relabel_rules = loki.relabel.journal.rules
format_as_json = true
labels = {component = "loki.source.journal", host = "${config.networking.hostName}"}
}

View file

@ -11,18 +11,21 @@
owner = "grafana";
group = "grafana";
restartUnits = [ "grafana.service" ];
sopsFile = ../../secrets/passwords.yaml;
};
secrets."services/loki/nginx" = {
mode = "0440";
owner = "nginx";
group = "nginx";
restartUnits = [ "nginx.service" ];
sopsFile = ../../secrets/passwords.yaml;
};
secrets."services/mimir/nginx" = {
mode = "0440";
owner = "nginx";
group = "nginx";
restartUnits = [ "nginx.service" ];
sopsFile = ../../secrets/passwords.yaml;
};
};