From bfe969884dac239dd94fa875e3ca5e0ab53aaee9 Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 24 May 2024 09:35:57 -0700 Subject: [PATCH] Add metrics port and enable metrics --- immich-ml-container.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/immich-ml-container.nix b/immich-ml-container.nix index 7c8ebb0..d7589c1 100644 --- a/immich-ml-container.nix +++ b/immich-ml-container.nix @@ -18,6 +18,12 @@ in { default = 3003; }; + metrics-port = mkOption { + type = port; + description = "Port on which to supply metrics."; + default = 9090; + }; + state-directory = mkOption { type = str; description = "Path on which to store service state."; @@ -39,8 +45,10 @@ in { image = "ghcr.io/immich-app/immich-machine-learning:${cfg.immich-version}-cuda"; volumes = [ "${cfg.state-directory}:/cache" ]; - ports = [ "${toString cfg.port}:3003" ]; + ports = + [ "${toString cfg.port}:3003" "${toString cfg.metrics-port}:9090" ]; extraOptions = [ "--gpus=all" ]; + environment.IMMICH_METRICS = "true"; }; };