Add promtail for journal
Some checks failed
Run nix flake check / flake-check (push) Failing after 7m47s
Some checks failed
Run nix flake check / flake-check (push) Failing after 7m47s
This commit is contained in:
parent
8700e78752
commit
32425807fc
@ -1,7 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./monitoring.nix
|
||||
./monitoring
|
||||
./packages.nix
|
||||
./root-user.nix
|
||||
./root-ca.nix
|
||||
|
7
system/monitoring/default.nix
Normal file
7
system/monitoring/default.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./metrics.nix
|
||||
./logs.nix
|
||||
];
|
||||
}
|
37
system/monitoring/logs.nix
Normal file
37
system/monitoring/logs.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_address = "0.0.0.0";
|
||||
http_listen_port = 9099;
|
||||
};
|
||||
|
||||
clients = [
|
||||
{
|
||||
url = "http://monitoring01.home.2rjus.net:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
json = true;
|
||||
};
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "systemd_unit";
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal__hostname" ];
|
||||
target_label = "host";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user