Skip to content

Commit 34d95c9

Browse files
[chore] Add depends on to otelcol to wait on healthy opensearch (open-telemetry#1724)
* Add depends on to otelcol * changelog * Update docker-compose.minimal.yml Co-authored-by: Roger Coll <roger.coll@elastic.co> --------- Co-authored-by: Roger Coll <roger.coll@elastic.co>
1 parent a1cfe47 commit 34d95c9

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ the release.
1313
([#1707](https://github.com/open-telemetry/opentelemetry-demo/pull/1707))
1414
* [chore] Fix gen-proto for accountingservice
1515
([#1709](https://github.com/open-telemetry/opentelemetry-demo/pull/1709))
16+
* [chore] Add depends on to otelcol to wait on healthy opensearch
17+
([#1724](https://github.com/open-telemetry/opentelemetry-demo/pull/1724))
1618
* [accountingservice] bump OpenTelemetry .NET Automatic Instrumentation
1719
to 1.8.0 together with other dependencies
1820
([#1727](https://github.com/open-telemetry/opentelemetry-demo/pull/1727))

docker-compose.minimal.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,10 @@ services:
593593
- "${OTEL_COLLECTOR_PORT_GRPC}"
594594
- "${OTEL_COLLECTOR_PORT_HTTP}"
595595
depends_on:
596-
- jaeger
596+
jaeger:
597+
condition: service_started
598+
opensearch:
599+
condition: service_healthy
597600
logging: *logging
598601
environment:
599602
- ENVOY_PORT
@@ -653,4 +656,10 @@ services:
653656
hard: 65536
654657
ports:
655658
- "9200"
659+
healthcheck:
660+
test: curl -s http://localhost:9200/_cluster/health | grep status | grep -q '\\(green\\|yellow\\)'
661+
start_period: 10s
662+
interval: 5s
663+
timeout: 10s
664+
retries: 10
656665
logging: *logging

docker-compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,10 @@ services:
704704
- "${OTEL_COLLECTOR_PORT_GRPC}"
705705
- "${OTEL_COLLECTOR_PORT_HTTP}"
706706
depends_on:
707-
- jaeger
707+
jaeger:
708+
condition: service_started
709+
opensearch:
710+
condition: service_healthy
708711
logging: *logging
709712
environment:
710713
- ENVOY_PORT
@@ -764,4 +767,10 @@ services:
764767
hard: 65536
765768
ports:
766769
- "9200"
770+
healthcheck:
771+
test: curl -s http://localhost:9200/_cluster/health | grep -q '"status":"green"'
772+
start_period: 10s
773+
interval: 5s
774+
timeout: 10s
775+
retries: 10
767776
logging: *logging

0 commit comments

Comments
 (0)