diff --git a/hosts/box/default.nix b/hosts/box/default.nix index 389f52f..eacdcb7 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -287,6 +287,29 @@ in { domain = "graph.tapenet.org"; port = 2342; addr = "127.0.0.1"; + analytics.reporting.enable = false; + + provision = { + enable = true; + datasources = [ + { + name = "Prometheus"; + type = "prometheus"; + access = "proxy"; + url = + "http://127.0.0.1:${toString config.services.prometheus.port}"; + } + { + name = "Loki"; + type = "loki"; + access = "proxy"; + url = "http://127.0.0.1:${ + toString + config.services.loki.configuration.server.http_listen_port + }"; + } + ]; + }; }; loki = { @@ -354,6 +377,37 @@ in { }; }; + promtail = { + enable = true; + configuration = { + server = { + http_listen_port = 3031; + grpc_listen_port = 0; + }; + positions = { filename = "/tmp/positions.yaml"; }; + clients = [{ + url = "http://127.0.0.1:${ + toString + config.services.loki.configuration.server.http_listen_port + }/loki/api/v1/push"; + }]; + scrape_configs = [{ + job_name = "journal"; + journal = { + max_age = "12h"; + labels = { + job = "systemd-journal"; + host = "box"; + }; + }; + relabel_configs = [{ + source_labels = [ "__journal__systemd_unit" ]; + target_label = "unit"; + }]; + }]; + }; + }; + prometheus = { enable = true; port = 9001;