Add metrics port and enable metrics

This commit is contained in:
niten 2024-05-24 09:35:57 -07:00
parent 1835444855
commit bfe969884d
1 changed files with 9 additions and 1 deletions

View File

@ -18,6 +18,12 @@ in {
default = 3003; default = 3003;
}; };
metrics-port = mkOption {
type = port;
description = "Port on which to supply metrics.";
default = 9090;
};
state-directory = mkOption { state-directory = mkOption {
type = str; type = str;
description = "Path on which to store service state."; description = "Path on which to store service state.";
@ -39,8 +45,10 @@ in {
image = image =
"ghcr.io/immich-app/immich-machine-learning:${cfg.immich-version}-cuda"; "ghcr.io/immich-app/immich-machine-learning:${cfg.immich-version}-cuda";
volumes = [ "${cfg.state-directory}:/cache" ]; volumes = [ "${cfg.state-directory}:/cache" ];
ports = [ "${toString cfg.port}:3003" ]; ports =
[ "${toString cfg.port}:3003" "${toString cfg.metrics-port}:9090" ];
extraOptions = [ "--gpus=all" ]; extraOptions = [ "--gpus=all" ];
environment.IMMICH_METRICS = "true";
}; };
}; };