rico1: use redis for blocky

This commit is contained in:
Adithya 2024-10-29 00:51:16 +05:30
parent 748ba54041
commit 5889b175df
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
4 changed files with 33 additions and 7 deletions

View file

@ -103,6 +103,14 @@ in
{ targets = [ "blocky.rico2.labs.adtya.xyz" ]; }
];
}
{
job_name = "redis";
scheme = "https";
metrics_path = "/redis-metrics";
static_configs = [
{ targets = [ "rico1.labs.adtya.xyz" ]; }
];
}
];
};
};

View file

@ -1,12 +1,21 @@
_: {
services.redis.servers = {
blocky = {
bind = "10.10.10.11";
port = 6379;
services = {
prometheus.exporters.redis = {
enable = true;
listenAddress = "127.0.0.1";
port = 9121;
};
caddy = {
bind = "10.10.10.11";
port = 6380;
redis.servers = {
blocky = {
enable = true;
bind = "10.10.10.11";
port = 6379;
};
caddy = {
enable = true;
bind = "10.10.10.11";
port = 6380;
};
};
};
}

View file

@ -115,6 +115,9 @@
enable = true;
path = "/metrics";
};
redis = {
address = "10.10.10.11:6379";
};
log = {
level = "warn";
format = "json";

View file

@ -31,6 +31,12 @@ in
reverse_proxy ${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port}
}
''}
${lib.optionalString config.services.prometheus.exporters.redis.enable ''
handle /redis-metrics {
uri replace /redis-metrics /metrics
reverse_proxy ${config.services.prometheus.exporters.redis.listenAddress}:${toString config.services.prometheus.exporters.redis.port}
}
''}
'';
};
};