Skip to content
Snippets Groups Projects
Commit e9b28a79 authored by Florian Sesser's avatar Florian Sesser
Browse files

Move promtail service config to promtail config

Do some name resolution for those poor computers

Improve factoring by removing those `/etc/hosts` entries

And avoid the infinite loop @tomprince was encountering in !258
parent f77dc30c
Branches
No related tags found
2 merge requests!264merge develop into production,!251Loki/Promtail: Towards centralized logging
...@@ -57,13 +57,6 @@ ...@@ -57,13 +57,6 @@
# qualified domain name. # qualified domain name.
deployment.targetHost = config.networking.fqdn; deployment.targetHost = config.networking.fqdn;
networking.hosts = {
# To stream logs to the monitoring host, all nodes need to know its address
${nodes.monitoring.config.services.private-storage.monitoring.vpn.server.ip} = [
"monitoring" "monitoring.monitoringvpn"
];
};
services.private-storage.monitoring.exporters.promtail.enable = true; services.private-storage.monitoring.exporters.promtail.enable = true;
assertions = [ assertions = [
......
...@@ -15,6 +15,14 @@ let ...@@ -15,6 +15,14 @@ let
in { in {
options.services.private-storage.monitoring.exporters.promtail = { options.services.private-storage.monitoring.exporters.promtail = {
enable = lib.mkEnableOption "Promtail log exporter service"; enable = lib.mkEnableOption "Promtail log exporter service";
lokiUrl = lib.mkOption {
type = lib.types.str;
description = ''
The server URL that logs should be pushed to.
'';
# Resolving names is hard, let's have breakfast
default = "http://172.23.23.1:3100/loki/api/v1/push";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
...@@ -28,7 +36,7 @@ in { ...@@ -28,7 +36,7 @@ in {
}; };
clients = [{ clients = [{
url = "http://monitoring:3100/loki/api/v1/push"; url = cfg.lokiUrl;
}]; }];
scrape_configs = [{ scrape_configs = [{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment