diff --git a/nixos/modules/monitoring/exporters/promtail.nix b/nixos/modules/monitoring/exporters/promtail.nix index c056ebeb2c5982ae47c3df9707f30b5159b284d3..e279b481862135c3ece61a4c28590698110cdb8a 100644 --- a/nixos/modules/monitoring/exporters/promtail.nix +++ b/nixos/modules/monitoring/exporters/promtail.nix @@ -39,6 +39,10 @@ in { host = hostName; }; }; + # The journal has many internal labels, that by default will + # be dropped because of their "__" prefix. To keep them, rename them. + # https://grafana.com/docs/loki/latest/clients/promtail/scraping/#journal-scraping-linux-only + # https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html relabel_configs = [{ source_labels = [ "__journal__systemd_unit" ]; target_label = "unit";