Skip to content

Commit

Permalink
Support nginx error logs in promtail scrape configs
Browse files Browse the repository at this point in the history
  • Loading branch information
karandit committed Aug 3, 2023
1 parent 674ce5a commit a2e115f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/wireguard-monitoring/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,23 @@ in {
replacement = "$2";
}
];
}];
}] ++ (if config.services.nginx.enable
then [{
job_name = "nginx-error-logs";
static_configs = [{
targets = [ "localhost" ];
labels = {
job = "nginx-error-logs";
host = config.networking.hostName;
__path__ = "/var/log/nginx/*error.log";
};
}];
}] else []);
};
};

users.users.promtail.extraGroups = lib.mkIf config.services.nginx.enable [ "nginx" ];

# wait for wireguard before starting node-exporter
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg0.service" ];
};
Expand Down

0 comments on commit a2e115f

Please sign in to comment.