fix(fastapi): use metrics in cases where PROMETHEUS_MULTIPROC_DIR is defined

Previously, we restricted this to gunicorn to get it working on aur-dev.
This change makes it usable through any backend, and also no-op if
PROMETHEUS_MULTIPROC_DIR is not defined.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-01 14:18:19 -07:00
parent cdb854259a
commit 9aa8decf40
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 7 additions and 3 deletions

View file

@ -241,6 +241,7 @@ services:
environment:
- AUR_CONFIG=conf/config
- TEST_RECURSION_LIMIT=${TEST_RECURSION_LIMIT}
- PROMETHEUS_MULTIPROC_DIR=/tmp_prometheus
entrypoint: /docker/test-mysql-entrypoint.sh
command: /docker/scripts/run-pytests.sh clean
stdin_open: true
@ -267,6 +268,7 @@ services:
environment:
- AUR_CONFIG=conf/config.sqlite
- TEST_RECURSION_LIMIT=${TEST_RECURSION_LIMIT}
- PROMETHEUS_MULTIPROC_DIR=/tmp_prometheus
entrypoint: /docker/test-sqlite-entrypoint.sh
command: setup-sqlite.sh run-pytests.sh clean
stdin_open: true
@ -289,6 +291,7 @@ services:
environment:
- AUR_CONFIG=conf/config
- TEST_RECURSION_LIMIT=${TEST_RECURSION_LIMIT}
- PROMETHEUS_MULTIPROC_DIR=/tmp_prometheus
entrypoint: /docker/tests-entrypoint.sh
command: setup-sqlite.sh run-tests.sh
stdin_open: true