fix: prometheus remote write

This commit is contained in:
Noah Masur 2023-07-14 02:52:23 +00:00
parent e86b2f184f
commit 9d4bf082c7

View File

@ -10,8 +10,9 @@
services.prometheus = { services.prometheus = {
exporters.node.enable = true; exporters.node.enable = true;
extraFlags = lib.mkIf isServer [ "--web.enable-remote-write-receiver" ];
scrapeConfigs = [{ scrapeConfigs = [{
job_name = "local"; job_name = config.networking.hostName;
static_configs = [{ targets = [ "127.0.0.1:9100" ]; }]; static_configs = [{ targets = [ "127.0.0.1:9100" ]; }];
}]; }];
webExternalUrl = webExternalUrl =
@ -28,7 +29,7 @@
}); });
remoteWrite = lib.mkIf (!isServer) [{ remoteWrite = lib.mkIf (!isServer) [{
name = config.networking.hostName; name = config.networking.hostName;
url = "https://${config.hostnames.prometheus}"; url = "https://${config.hostnames.prometheus}/api/v1/write";
basic_auth = { basic_auth = {
# Uses password hashed with bcrypt above # Uses password hashed with bcrypt above
username = "prometheus"; username = "prometheus";