diff --git a/.env b/.env index 5bda30c..d047202 100644 --- a/.env +++ b/.env @@ -126,6 +126,10 @@ METRIC_PRUNING_ROUTINE_DELAY_FIRST_RUN_SECONDS=5 # from the time the pruning routine runs # all metrics for earlier days will be truncated METRIC_PRUNING_MAX_REQUEST_METRICS_HISTORY_DAYS=45 +# If we use metric database. If set to false, +# all metric collection and connection to the DB would be disabled +# and the service would run without any metrics. +METRIC_DATABASE_ENABLED=${METRIC_DATABASE_ENABLED:-true} # CACHE_ENABLED specifies if cache should be enabled. By default cache is disabled. CACHE_ENABLED=true # REDIS_ENDPOINT_URL is an url of redis diff --git a/.github/workflows/ci-e2e-no-metrics-tests.yml b/.github/workflows/ci-e2e-no-metrics-tests.yml index 77e483a..1094fce 100644 --- a/.github/workflows/ci-e2e-no-metrics-tests.yml +++ b/.github/workflows/ci-e2e-no-metrics-tests.yml @@ -17,9 +17,9 @@ jobs: - name: pull pre-built images run: sudo docker compose -f ci.docker-compose.yml pull - name: build and start proxy service and it's dependencies - # We need to provide additional env file to override the METRIC_DATABASE_ENABLED variable, not via env variable. - # Mentioned here: https://github.com/docker/compose/issues/9737 - run: sudo docker compose -f ci.docker-compose.yml --env-file .env --env-file no_metric.env up -d --build proxy redis + run: sudo docker compose -f ci.docker-compose.yml up -d --build proxy redis + env: + METRIC_DATABASE_ENABLED: "false" - name: wait for proxy service to be running run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-running.sh env: diff --git a/ci.docker-compose.yml b/ci.docker-compose.yml index b6cd84e..bf52bfc 100644 --- a/ci.docker-compose.yml +++ b/ci.docker-compose.yml @@ -34,7 +34,7 @@ services: EVM_QUERY_SERVICE_URL: https://evmrpc.internal.testnet.proxy.kava.io # we need the metric to be used from no_metric.env or by default set up as true, so to test the metrics collection. # doesn't work with the env variable, so need env file. Mentioned here: https://github.com/docker/compose/issues/9737 - METRIC_DATABASE_ENABLED: "${METRIC_DATABASE_ENABLED}:-true" + METRIC_DATABASE_ENABLED: "${METRIC_DATABASE_ENABLED}" ports: - "${PROXY_HOST_PORT}:${PROXY_CONTAINER_PORT}" - "${TEST_UNCONFIGURED_PROXY_PORT}:${PROXY_CONTAINER_PORT}"