mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-26 00:18:28 +02:00
more monitoring
This commit is contained in:
parent
3f206d8fe0
commit
d58be54704
7 changed files with 128 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
users.users."promtail".extraGroups = [ "caddy" "systemd-journal" ];
|
||||
services.prometheus = {
|
||||
exporters = {
|
||||
node = {
|
||||
|
@ -8,6 +9,58 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 3031;
|
||||
grpc_listen_port = 0;
|
||||
};
|
||||
positions = {
|
||||
filename = "/tmp/positions.yaml";
|
||||
};
|
||||
clients = [{
|
||||
url = "http://nuc.vpn.rfive.de:3030/loki/api/v1/push";
|
||||
}];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
json = false;
|
||||
max_age = "12h";
|
||||
path = "/var/log/journal";
|
||||
labels.job = "systemd-journal";
|
||||
};
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "unit";
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal__hostname" ];
|
||||
target_label = "host";
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal_priority_keyword" ];
|
||||
target_label = "level";
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal_syslog_identifier" ];
|
||||
target_label = "syslog_identifier";
|
||||
}
|
||||
];
|
||||
pipeline_stages = [
|
||||
{
|
||||
match = {
|
||||
selector = ''{unit="promtail.servicel"}'';
|
||||
action = "drop";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
config.services.prometheus.exporters.node.port
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue