nixos/prometheus-redis-exporter: init
This commit is contained in:
parent
ac3a50122b
commit
344e64a4d9
@ -39,6 +39,7 @@ let
|
|||||||
"node"
|
"node"
|
||||||
"postfix"
|
"postfix"
|
||||||
"postgres"
|
"postgres"
|
||||||
|
"redis"
|
||||||
"rspamd"
|
"rspamd"
|
||||||
"snmp"
|
"snmp"
|
||||||
"surfboard"
|
"surfboard"
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, pkgs, options }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.prometheus.exporters.redis;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
port = 9121;
|
||||||
|
serviceOpts = {
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.prometheus-redis-exporter}/bin/redis_exporter \
|
||||||
|
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||||
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -475,6 +475,20 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
redis = {
|
||||||
|
exporterConfig = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
metricProvider.services.redis.enable = true;
|
||||||
|
exporterTest = ''
|
||||||
|
wait_for_unit("redis.service")
|
||||||
|
wait_for_unit("prometheus-redis-exporter.service")
|
||||||
|
wait_for_open_port(6379)
|
||||||
|
wait_for_open_port(9121)
|
||||||
|
wait_until_succeeds("curl -sSf localhost:9121/metrics | grep -q 'redis_up 1'")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
rspamd = {
|
rspamd = {
|
||||||
exporterConfig = {
|
exporterConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user