From 81bdbc2816fac33b192b7b4748f8c16543bd3015 Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 24 May 2024 09:34:12 -0700 Subject: [PATCH] Add metrics port and enable metrics --- immich-container.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/immich-container.nix b/immich-container.nix index 36ee1d4..dacdaaf 100644 --- a/immich-container.nix +++ b/immich-container.nix @@ -38,6 +38,12 @@ in { default = 3254; }; + metrics-port = mkOption { + type = port; + description = "Port on which to provide metrics."; + default = 9090; + }; + images = { immich = mkOption { type = str; @@ -71,6 +77,8 @@ in { POSTGRES_PASSWORD = readFile databasePassword; REDIS_HOSTNAME = "redis"; + + IMMICH_METRICS = "true"; }; target-file = "/run/immich/env"; }; @@ -88,7 +96,10 @@ in { service = { image = cfg.images.immich; restart = "always"; - ports = [ "${toString cfg.port}:3001" ]; + ports = [ + "${toString cfg.port}:3001" + "${toString cfg.metrics-port}:9090" + ]; command = [ "start.sh" "immich" ]; depends_on = [ "redis" "database" "immich-microservices" ]; volumes = [