From bc2b204759068b240feb1b6874a16d1e3c30bce3 Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Thu, 19 Jan 2023 09:01:32 -0500 Subject: [PATCH] Add healthcheck to featureflagservice (#661) * Add healthcheck to featureflagservice In order to assess the health of this central service, compose should perform a check on the service. * Add changelog entry Co-authored-by: Juliano Costa Co-authored-by: Carter Socha <43380952+cartersocha@users.noreply.github.com> --- CHANGELOG.md | 2 ++ docker-compose.yml | 2 ++ src/featureflagservice/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b105e37bf..e9e15f6d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -170,6 +170,8 @@ significant modifications will be credited to OpenTelemetry Authors. ([#648](https://github.com/open-telemetry/opentelemetry-demo/pull/648)) * Add Jaeger-SPM-Config ([#655](https://github.com/open-telemetry/opentelemetry-demo/pull/655)) +* Add healthcheck to featureflagservice +([#661](https://github.com/open-telemetry/opentelemetry-demo/pull/661) * Add resource detectors to checkout service ([#662](https://github.com/open-telemetry/opentelemetry-demo/pull/662)) * Add resource detectors to cart service diff --git a/docker-compose.yml b/docker-compose.yml index d898ae28fa..0e79d211eb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -236,6 +236,8 @@ services: - OTEL_SERVICE_NAME=featureflagservice - DATABASE_URL=ecto://ffs:ffs@ffs_postgres:5432/ffs - FEATURE_FLAG_SERVICE_PATH_ROOT="/feature" + healthcheck: + test: ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"] depends_on: ffs_postgres: condition: service_healthy diff --git a/src/featureflagservice/Dockerfile b/src/featureflagservice/Dockerfile index dbe237825c..0f428ede04 100644 --- a/src/featureflagservice/Dockerfile +++ b/src/featureflagservice/Dockerfile @@ -80,7 +80,7 @@ RUN mix release # the compiled release and other runtime necessities FROM ${RUNNER_IMAGE} -RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales \ +RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales curl \ && apt-get clean && rm -f /var/lib/apt/lists/*_* # Set the locale