add loki stuff

This commit is contained in:
Kopatz
2024-04-14 18:37:44 +02:00
parent c14539cbe3
commit 22e710bada
4 changed files with 324 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
let
useHttps = config.services.step-ca.enable;
fqdn = "grafana.home.arpa";
base = "/mnt/250ssd";
in
{
age.secrets.grafana-contact-points = {
@@ -12,11 +13,16 @@ in
services.grafana = {
enable = true;
dataDir = "${base}/grafana";
settings.server = {
domain = fqdn;
http_port = 2342;
http_addr = "127.0.0.1";
};
settings.log = {
mode = "console";
level = "warn";
};
provision.alerting.contactPoints.path = config.age.secrets.grafana-contact-points.path;
provision.alerting.policies.path = ./grafana/notification-policies.yml;
@@ -30,6 +36,11 @@ in
type = "prometheus";
isDefault = true;
}
{
name = "loki";
url = "http://localhost:3100";
type = "loki";
}
];
};
provision.dashboards.settings.providers = [{
@@ -62,6 +73,7 @@ in
node = {
enable = true;
enabledCollectors = [ "systemd" ];
disabledCollectors = [ "arp" ];
port = 9001;
};
};
@@ -91,7 +103,7 @@ in
# Logs
services.loki = {
enable = true;
dataDir = "/mnt/250ssd/loki";
dataDir = "${base}/loki";
configFile = ./grafana/loki.yml;
};