From 70ff2a8346916f8888d979740811cf409593d277 Mon Sep 17 00:00:00 2001 From: Evandro Myller Date: Thu, 15 Jan 2026 13:10:36 -0300 Subject: [PATCH 1/5] Map ports for new /metrics endpoint --- .../aws/staging/ecs-task-definition-task-processor.json | 5 +++++ infrastructure/aws/staging/ecs-task-definition-web.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/infrastructure/aws/staging/ecs-task-definition-task-processor.json b/infrastructure/aws/staging/ecs-task-definition-task-processor.json index 413850117561..ecafcfd7e872 100644 --- a/infrastructure/aws/staging/ecs-task-definition-task-processor.json +++ b/infrastructure/aws/staging/ecs-task-definition-task-processor.json @@ -8,6 +8,11 @@ "name": "flagsmith-task-processor", "command": ["run-task-processor"], "portMappings": [ + { + "containerPort": 9100, + "hostPort": 9100, + "protocol": "tcp" + }, { "containerPort": 8000, "hostPort": 8000, diff --git a/infrastructure/aws/staging/ecs-task-definition-web.json b/infrastructure/aws/staging/ecs-task-definition-web.json index ffebe6b0ae00..b4de945e1100 100644 --- a/infrastructure/aws/staging/ecs-task-definition-web.json +++ b/infrastructure/aws/staging/ecs-task-definition-web.json @@ -11,6 +11,11 @@ ], "cpu": 0, "portMappings": [ + { + "containerPort": 9100, + "hostPort": 9100, + "protocol": "tcp" + }, { "containerPort": 8000, "hostPort": 8000, From cbfc653eae4447e5d481d782086175a63959e3da Mon Sep 17 00:00:00 2001 From: Evandro Myller Date: Fri, 16 Jan 2026 20:28:43 -0300 Subject: [PATCH 2/5] DROPME: Point to a dev version of flagsmith-common --- api/poetry.lock | 44 ++++++++++++++++++++++++-------------------- api/pyproject.toml | 2 +- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/api/poetry.lock b/api/poetry.lock index b8b5c54670b2..25716f8a71fd 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -2001,36 +2001,40 @@ name = "flagsmith-common" version = "3.2.1" description = "Flagsmith's common library" optional = false -python-versions = "<4.0,>=3.11" +python-versions = ">=3.11,<4.0" groups = ["main", "dev", "licensing", "workflows"] -files = [ - {file = "flagsmith_common-3.2.1-py3-none-any.whl", hash = "sha256:63ce0c920e0b5d0a145b2f01239191e5250828db1ec73f92d44be756ad738abb"}, - {file = "flagsmith_common-3.2.1.tar.gz", hash = "sha256:791bd58933ec3242bee2bff1ef9e0ee3d22164d824aa8512eb054ade79eca9d7"}, -] +files = [] +develop = false [package.dependencies] -backoff = {version = ">=2.2.1,<3.0.0", optional = true, markers = "extra == \"task-processor\""} -django = {version = ">4,<6", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} -django-health-check = {version = "*", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} -djangorestframework = {version = "*", optional = true, markers = "extra == \"common-core\""} -djangorestframework-recursive = {version = "*", optional = true, markers = "extra == \"common-core\""} -drf-spectacular = {version = ">=0.28.0,<1", optional = true, markers = "extra == \"common-core\""} -drf-writable-nested = {version = "*", optional = true, markers = "extra == \"common-core\""} -environs = {version = "<15", optional = true, markers = "extra == \"common-core\""} -gunicorn = {version = ">=19.1", optional = true, markers = "extra == \"common-core\""} -prometheus-client = {version = ">=0.0.16", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} -psycopg2-binary = {version = ">=2.9,<3", optional = true, markers = "extra == \"common-core\""} +backoff = {version = ">=2.2.1,<3.0.0", optional = true} +django = {version = ">4,<6", optional = true} +django-health-check = {version = "*", optional = true} +djangorestframework = {version = "*", optional = true} +djangorestframework-recursive = {version = "*", optional = true} +drf-spectacular = {version = ">=0.28.0,<1", optional = true} +drf-writable-nested = {version = "*", optional = true} +environs = {version = "<15", optional = true} +gunicorn = {version = ">=19.1", optional = true} +prometheus-client = {version = ">=0.0.16", optional = true} +psycopg2-binary = {version = ">=2.9,<3", optional = true} pyfakefs = {version = ">=5,<6", optional = true, markers = "extra == \"test-tools\""} pytest-django = {version = ">=4,<5", optional = true, markers = "extra == \"test-tools\""} -requests = {version = "*", optional = true, markers = "extra == \"common-core\""} -simplejson = {version = ">=3,<4", optional = true, markers = "extra == \"common-core\""} +requests = {version = "*", optional = true} +simplejson = {version = ">=3,<4", optional = true} [package.extras] common-core = ["django (>4,<6)", "django-health-check", "djangorestframework", "djangorestframework-recursive", "drf-spectacular (>=0.28.0,<1)", "drf-writable-nested", "environs (<15)", "gunicorn (>=19.1)", "prometheus-client (>=0.0.16)", "psycopg2-binary (>=2.9,<3)", "requests", "simplejson (>=3,<4)"] -flagsmith-schemas = ["flagsmith-flag-engine (>6)", "typing-extensions"] +flagsmith-schemas = ["flagsmith-flag-engine (>6)", "typing_extensions"] task-processor = ["backoff (>=2.2.1,<3.0.0)", "django (>4,<6)", "django-health-check", "prometheus-client (>=0.0.16)"] test-tools = ["pyfakefs (>=5,<6)", "pytest-django (>=4,<5)"] +[package.source] +type = "git" +url = "https://github.com/flagsmith/flagsmith-common" +reference = "fix/metrics-availability" +resolved_reference = "5b9903204562b3683281ecd5f0eca93cf752f8d3" + [[package]] name = "flagsmith-flag-engine" version = "6.0.2" @@ -5330,4 +5334,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">3.11,<3.13" -content-hash = "4682f42c4efa9cca5a3533a787373c5daf2a2b941bbda17f818a2cfa1fa36737" +content-hash = "5dd18adbb49f34e92c56eac1836625e4612f6130581700c65867509d2a316fcb" diff --git a/api/pyproject.toml b/api/pyproject.toml index 5ade4e4b807c..322f1998daa6 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -162,7 +162,7 @@ pygithub = "2.1.1" hubspot-api-client = "^8.2.1" djangorestframework-dataclasses = "^1.3.1" pyotp = "^2.9.0" -flagsmith-common = {version = "^3.2.1", extras = ["common-core", "task-processor"]} +flagsmith-common = {git = "https://github.com/flagsmith/flagsmith-common", branch = "fix/metrics-availability", extras = ["common-core", "task-processor"]} django-stubs = "^5.1.3" tzdata = "^2024.1" djangorestframework-simplejwt = "^5.5.1" From 7036b9a4d1578d2d55c01d08ef4800b4c692be01 Mon Sep 17 00:00:00 2001 From: Evandro Myller Date: Fri, 16 Jan 2026 21:07:02 -0300 Subject: [PATCH 3/5] Fix LOG_LEVEL in staging --- .../aws/staging/ecs-task-definition-task-processor.json | 4 ++++ infrastructure/aws/staging/ecs-task-definition-web.json | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/infrastructure/aws/staging/ecs-task-definition-task-processor.json b/infrastructure/aws/staging/ecs-task-definition-task-processor.json index ecafcfd7e872..0b1f6dffe7d7 100644 --- a/infrastructure/aws/staging/ecs-task-definition-task-processor.json +++ b/infrastructure/aws/staging/ecs-task-definition-task-processor.json @@ -167,6 +167,10 @@ { "name": "TASK_PROCESSOR_NUM_THREADS", "value": "12" + }, + { + "name": "LOG_LEVEL", + "value": "INFO" } ], "secrets": [ diff --git a/infrastructure/aws/staging/ecs-task-definition-web.json b/infrastructure/aws/staging/ecs-task-definition-web.json index b4de945e1100..3489cb6f9d84 100644 --- a/infrastructure/aws/staging/ecs-task-definition-web.json +++ b/infrastructure/aws/staging/ecs-task-definition-web.json @@ -34,10 +34,6 @@ }, "essential": true, "environment": [ - { - "name": "LOG_LEVEL", - "value": "INFO" - }, { "name": "AWS_REGION", "value": "eu-west-2" @@ -320,4 +316,4 @@ ], "cpu": "1024", "memory": "2048" -} \ No newline at end of file +} From b2bc013953269e24a037fc4298c75c7398ed385f Mon Sep 17 00:00:00 2001 From: Evandro Myller Date: Tue, 20 Jan 2026 15:31:01 -0300 Subject: [PATCH 4/5] Update flagsmith-common --- api/poetry.lock | 46 +++++++++++++++++++++------------------------- api/pyproject.toml | 2 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/api/poetry.lock b/api/poetry.lock index 6393c2452e19..f3c8405f9e48 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1998,43 +1998,39 @@ resolved_reference = "f5dfd44935c41bb6d777deb06c7e06b3e44210ad" [[package]] name = "flagsmith-common" -version = "3.2.1" +version = "3.3.0" description = "Flagsmith's common library" optional = false -python-versions = ">=3.11,<4.0" +python-versions = "<4.0,>=3.11" groups = ["main", "dev", "licensing", "workflows"] -files = [] -develop = false +files = [ + {file = "flagsmith_common-3.3.0-py3-none-any.whl", hash = "sha256:dcb94458c7fd1bbc7762080d5c11c1d97507beac48a71132209f322112d8c60d"}, + {file = "flagsmith_common-3.3.0.tar.gz", hash = "sha256:e2839eda7091f13794efbaa7e20895110f9fbf5953dd67f70585b93e7c5864fa"}, +] [package.dependencies] -backoff = {version = ">=2.2.1,<3.0.0", optional = true} -django = {version = ">4,<6", optional = true} -django-health-check = {version = "*", optional = true} -djangorestframework = {version = "*", optional = true} -djangorestframework-recursive = {version = "*", optional = true} -drf-spectacular = {version = ">=0.28.0,<1", optional = true} -drf-writable-nested = {version = "*", optional = true} -environs = {version = "<15", optional = true} -gunicorn = {version = ">=19.1", optional = true} -prometheus-client = {version = ">=0.0.16", optional = true} -psycopg2-binary = {version = ">=2.9,<3", optional = true} +backoff = {version = ">=2.2.1,<3.0.0", optional = true, markers = "extra == \"task-processor\""} +django = {version = ">4,<6", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} +django-health-check = {version = "*", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} +djangorestframework = {version = "*", optional = true, markers = "extra == \"common-core\""} +djangorestframework-recursive = {version = "*", optional = true, markers = "extra == \"common-core\""} +drf-spectacular = {version = ">=0.28.0,<1", optional = true, markers = "extra == \"common-core\""} +drf-writable-nested = {version = "*", optional = true, markers = "extra == \"common-core\""} +environs = {version = "<15", optional = true, markers = "extra == \"common-core\""} +gunicorn = {version = ">=19.1", optional = true, markers = "extra == \"common-core\""} +prometheus-client = {version = ">=0.0.16", optional = true, markers = "extra == \"common-core\" or extra == \"task-processor\""} +psycopg2-binary = {version = ">=2.9,<3", optional = true, markers = "extra == \"common-core\""} pyfakefs = {version = ">=5,<6", optional = true, markers = "extra == \"test-tools\""} pytest-django = {version = ">=4,<5", optional = true, markers = "extra == \"test-tools\""} -requests = {version = "*", optional = true} -simplejson = {version = ">=3,<4", optional = true} +requests = {version = "*", optional = true, markers = "extra == \"common-core\""} +simplejson = {version = ">=3,<4", optional = true, markers = "extra == \"common-core\""} [package.extras] common-core = ["django (>4,<6)", "django-health-check", "djangorestframework", "djangorestframework-recursive", "drf-spectacular (>=0.28.0,<1)", "drf-writable-nested", "environs (<15)", "gunicorn (>=19.1)", "prometheus-client (>=0.0.16)", "psycopg2-binary (>=2.9,<3)", "requests", "simplejson (>=3,<4)"] -flagsmith-schemas = ["flagsmith-flag-engine (>6)", "typing_extensions"] +flagsmith-schemas = ["flagsmith-flag-engine (>6)", "simplejson", "typing-extensions"] task-processor = ["backoff (>=2.2.1,<3.0.0)", "django (>4,<6)", "django-health-check", "prometheus-client (>=0.0.16)"] test-tools = ["pyfakefs (>=5,<6)", "pytest-django (>=4,<5)"] -[package.source] -type = "git" -url = "https://github.com/flagsmith/flagsmith-common" -reference = "fix/metrics-availability" -resolved_reference = "5b9903204562b3683281ecd5f0eca93cf752f8d3" - [[package]] name = "flagsmith-flag-engine" version = "6.0.2" @@ -5334,4 +5330,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">3.11,<3.13" -content-hash = "5dd18adbb49f34e92c56eac1836625e4612f6130581700c65867509d2a316fcb" +content-hash = "4446acda8d9a50e1b59a68ce1721a282c99d5f1cb1189795f9df32d3f1edaf7c" diff --git a/api/pyproject.toml b/api/pyproject.toml index 322f1998daa6..ac37b7bf869f 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -162,7 +162,7 @@ pygithub = "2.1.1" hubspot-api-client = "^8.2.1" djangorestframework-dataclasses = "^1.3.1" pyotp = "^2.9.0" -flagsmith-common = {git = "https://github.com/flagsmith/flagsmith-common", branch = "fix/metrics-availability", extras = ["common-core", "task-processor"]} +flagsmith-common = {version = "^3.3.0", extras = ["common_core", "task_processor"]} django-stubs = "^5.1.3" tzdata = "^2024.1" djangorestframework-simplejwt = "^5.5.1" From cfacc615e046d3196ae140fe64572f6d361b0ad0 Mon Sep 17 00:00:00 2001 From: Evandro Myller Date: Tue, 20 Jan 2026 15:34:11 -0300 Subject: [PATCH 5/5] Update auto-generated docs --- .../platform-configuration/metrics.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/administration-and-security/platform-configuration/metrics.md b/docs/docs/administration-and-security/platform-configuration/metrics.md index e58a4d14bec0..f61d761ce6a3 100644 --- a/docs/docs/administration-and-security/platform-configuration/metrics.md +++ b/docs/docs/administration-and-security/platform-configuration/metrics.md @@ -6,7 +6,9 @@ sidebar_position: 20 ## Prometheus -To enable the Prometheus `/metrics` endpoint, set the `PROMETHEUS_ENABLED` environment variable to `true`. +To enable the Prometheus `/metrics` endpoint, set the `PROMETHEUS_ENABLED` environment variable to `true`. + +When enabled, Flagsmith serves the `/metrics` endpoint on port 9100. The metrics provided by Flagsmith are described below.