Prepare for remote push metrics

This commit is contained in:
Ilya K 2024-07-07 17:58:51 +03:00
parent c144d76613
commit 31ee302ec9
5 changed files with 13 additions and 6 deletions

View file

@ -12,8 +12,8 @@ in
config = mkIf cfg.enable {
age.secrets = {
loki-htpasswd = {
file = ../../../secrets/loki-htpasswd.age;
metrics-push-htpasswd = {
file = ../../../secrets/metrics-push-htpasswd.age;
owner = "nginx";
};
loki-environment.file = ../../../secrets/loki-environment.age;
@ -93,7 +93,7 @@ in
forceSSL = true;
locations."/loki/api/v1/push" = {
proxyPass = "http://localhost:${toString config.services.loki.configuration.server.http_listen_port}";
basicAuthFile = config.age.secrets.loki-htpasswd.path;
basicAuthFile = config.age.secrets.metrics-push-htpasswd.path;
};
};
};

View file

@ -34,7 +34,13 @@ in
options.bagel.services.prometheus.enable = mkEnableOption "Prometheus scraper";
config = mkIf cfg.enable {
age.secrets.mimir-environment.file = ../../../secrets/mimir-environment.age;
age.secrets = {
metrics-push-htpasswd = {
file = ../../../secrets/metrics-push-htpasswd.age;
owner = "nginx";
};
mimir-environment.file = ../../../secrets/mimir-environment.age;
};
services.prometheus = {
enable = true;
@ -109,8 +115,9 @@ in
services.nginx.virtualHosts."mimir.forkos.org" = {
enableACME = true;
forceSSL = true;
locations."/" = {
locations."/api/v1/push" = {
proxyPass = "http://localhost:${toString mimirPort}";
basicAuthFile = config.age.secrets.metrics-push-htpasswd.path;
};
};
};

View file

@ -12,7 +12,7 @@ in
config = mkIf cfg.enable {
age.secrets.promtail-password = {
file = ../../secrets/promtail-password.age;
file = ../../secrets/metrics-push-password.age;
owner = "promtail";
};