metrics: allow customizing address in full; add tests

This commit is contained in:
raf 2025-05-01 20:42:48 +03:00
commit 2da4d6d203
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 103 additions and 18 deletions

View file

@ -16,7 +16,7 @@ self: {
# Generate the config.json content
erisConfigFile = pkgs.writeText "eris-config.json" (toJSON {
listen_addr = cfg.listenAddress;
metrics_port = cfg.metricsPort;
metrics_addr = cfg.metricsAddress;
backend_addr = cfg.backendAddress;
min_delay = cfg.minDelay;
max_delay = cfg.maxDelay;
@ -50,11 +50,11 @@ in {
example = "127.0.0.1:9999";
};
metricsPort = mkOption {
type = port;
default = 9100;
example = 9110;
description = "The port for the Prometheus metrics endpoint.";
metricsAddress = mkOption {
type = str;
default = "0.0.0.0:9100";
example = "127.0.0.1:9100";
description = "The IP address and port for the Prometheus metrics endpoint.";
};
backendAddress = mkOption {