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" ]; } { 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 = { services = {
prometheus.exporters.redis = {
enable = true;
listenAddress = "127.0.0.1";
port = 9121;
};
redis.servers = {
blocky = { blocky = {
enable = true;
bind = "10.10.10.11"; bind = "10.10.10.11";
port = 6379; port = 6379;
}; };
caddy = { caddy = {
enable = true;
bind = "10.10.10.11"; bind = "10.10.10.11";
port = 6380; port = 6380;
}; };
}; };
};
} }

View file

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

View file

@ -31,6 +31,12 @@ in
reverse_proxy ${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port} 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}
}
''}
''; '';
}; };
}; };