sid.ovh/modules/nixos/loki/default.nix
sid e6bfb11be0
All checks were successful
Build hosts / build-hosts (pull_request) Successful in 22s
Flake check / flake-check (pull_request) Successful in 45s
grafana: add logs dashboard
2026-05-22 19:20:36 +02:00

74 lines
1.4 KiB
Nix

{
services.loki = {
enable = true;
configuration = {
auth_enabled = false;
server.http_listen_port = 3100;
common = {
ring = {
instance_addr = "127.0.0.1";
kvstore.store = "inmemory";
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
};
schema_config = {
configs = [
{
from = "2020-10-24";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
storage_config = {
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
};
};
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "0.0.0.0";
http_port = 3003;
};
"auth.anonymous" = {
enabled = true;
org_name = "Main Org.";
org_role = "Admin";
};
};
provision = {
enable = true;
datasources.settings.datasources = [
{
name = "Loki";
type = "loki";
access = "proxy";
url = "http://127.0.0.1:3100";
isDefault = true;
uid = "Loki";
}
];
dashboards.settings.providers = [
{
name = "default";
options.path = ./dashboards;
}
];
};
};
}