Added loki for logging to eko
This commit is contained in:
19
nixosModules/eko-config.alloy
Normal file
19
nixosModules/eko-config.alloy
Normal file
@@ -0,0 +1,19 @@
|
||||
local.file_match "eko_logs" {
|
||||
path_targets = [
|
||||
{ __path__ = "/srv/eko/logs/eko-server-*.log" },
|
||||
]
|
||||
sync_period = "3s"
|
||||
}
|
||||
|
||||
loki.source.file "eko_tail" {
|
||||
targets = local.file_match.eko_logs.targets
|
||||
forward_to = [loki.write.eko.receiver]
|
||||
tail_from_end = true
|
||||
}
|
||||
|
||||
loki.write "eko" {
|
||||
endpoint {
|
||||
url = "http://localhost:3100/loki/api/v1/push"
|
||||
}
|
||||
external_labels = { app = "eko-server" }
|
||||
}
|
||||
@@ -5,9 +5,6 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf config.eko.enable {
|
||||
grafana.enable = true;
|
||||
loki.enable = true;
|
||||
|
||||
users.groups.eko = { };
|
||||
users.users.eko = {
|
||||
createHome = false;
|
||||
@@ -67,5 +64,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Enable metrics/logging
|
||||
grafana.enable = true;
|
||||
loki.enable = true;
|
||||
services.alloy.enable = true;
|
||||
environment.etc = {
|
||||
"alloy/eko-config.alloy".text = builtins.readFile ./eko-config.alloy;
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user