summaryrefslogtreecommitdiff
path: root/nixos/hosts/tente/monitoring.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/hosts/tente/monitoring.nix')
-rw-r--r--nixos/hosts/tente/monitoring.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/hosts/tente/monitoring.nix b/nixos/hosts/tente/monitoring.nix
index 7e92eed..545ae24 100644
--- a/nixos/hosts/tente/monitoring.nix
+++ b/nixos/hosts/tente/monitoring.nix
@@ -57,6 +57,8 @@ in
services.prometheus = {
enable = true;
+ retentionTime = "1y";
+
scrapeConfigs = [
{
job_name = "node";
@@ -180,8 +182,8 @@ in
forward_to = [loki.write.default.receiver]
stage.match {
- // Select messages from systemd services that have LogExtraFields=log_format=logfmt.
- selector = "{__journal_log_format=\"logfmt\"}"
+ // Select messages from systemd services that have LogExtraFields=LOG_FORMAT=logfmt.
+ selector = "{__journal_LOG_FORMAT=\"logfmt\"}"
stage.logfmt {
mapping = { time = "", level = "" }
}
@@ -189,6 +191,11 @@ in
source = "time"
format = "RFC3339"
}
+ stage.template {
+ // The slog package of the Go standard library prints levels as uppercase.
+ source = "level"
+ template = "{{ ToLower .Value }}"
+ }
stage.structured_metadata {
values = { level = "" }
}