From d61cd816a690895fa2b00fa145f4fedba8321430 Mon Sep 17 00:00:00 2001 From: Eduard Melnytskyi Date: Wed, 15 Jan 2025 21:18:21 +0100 Subject: [PATCH] Fix otel stack configuration and adjust documentation. --- docs/06-configuring-services.md | 2 +- .../otel-stack/latest/otel-stack.yml.twig | 44 +++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/06-configuring-services.md b/docs/06-configuring-services.md index f37e8c92..62b79ed7 100644 --- a/docs/06-configuring-services.md +++ b/docs/06-configuring-services.md @@ -675,7 +675,7 @@ This stack integrates the following containers into your local environment: grafana: engine: otel-stack endpoints: - grafana.spryker.local: + grafana: ``` 2. Bootstrap the docker setup and rebuild the application: diff --git a/generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig b/generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig index e2d31a42..f6455be9 100644 --- a/generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig +++ b/generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig @@ -19,7 +19,7 @@ - {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/tempo:rw networks: - private - expose: + ports: - "14268" # jaeger ingest - "3200" # tempo - "4317" # otlp grpc @@ -27,6 +27,12 @@ - "9411" # zipkin depends_on: - tempo-init + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:3200/metrics" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s collector: image: otel/opentelemetry-collector:0.86.0 @@ -35,7 +41,15 @@ - ./${DEPLOYMENT_PATH}/context/otel-stack/otel-collector.yaml:/etc/otel-collector.yaml networks: - private - + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:13133/health" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + ports: + - "4318:4318" + - "4317:4317" prometheus: image: prom/prometheus:latest command: @@ -46,8 +60,14 @@ - private volumes: - ./${DEPLOYMENT_PATH}/context/otel-stack/prometheus.yaml:/etc/prometheus.yaml - expose: - - "9090" + ports: + - "9090:9090" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:9090/-/healthy" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s grafana: image: grafana/grafana:11.0.0 @@ -61,7 +81,15 @@ - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - GF_AUTH_DISABLE_LOGIN_FORM=true - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor - - expose: - - "3000" - + labels: + 'spryker.app.name': grafana + 'spryker.app.type': hidden + 'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG} + ports: + - "3000:3000" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:3000/" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s