mirror of
https://github.com/tuxdotrs/tnvim.git
synced 2025-07-06 21:36:34 +05:30
refactor: categorised apps
This commit is contained in:
55
modules/nixos/selfhosted/monitoring/promtail.nix
Normal file
55
modules/nixos/selfhosted/monitoring/promtail.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{lib, ...}: {
|
||||
services = {
|
||||
promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 9080;
|
||||
grpc_listen_port = 0;
|
||||
};
|
||||
positions = {
|
||||
filename = "/var/lib/promtail/positions.yaml";
|
||||
};
|
||||
clients = [
|
||||
{
|
||||
url = "https://loki.tux.rs/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
};
|
||||
};
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = [
|
||||
"__journal__systemd_unit"
|
||||
];
|
||||
target_label = "unit";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nginx = {
|
||||
enable = lib.mkForce true;
|
||||
virtualHosts = {
|
||||
"promtail.tux.rs" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "tux.rs";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:9080";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user