diff --git a/docker-compose/cassandra/v4/docker-compose.yaml b/docker-compose/cassandra/v4/docker-compose.yaml index 196a1b62225..b18539798bc 100644 --- a/docker-compose/cassandra/v4/docker-compose.yaml +++ b/docker-compose/cassandra/v4/docker-compose.yaml @@ -1,6 +1,7 @@ services: cassandra: image: cassandra:4.1 + container_name: "cassandra-4" ports: - "9042:9042" - "9160:9160" @@ -11,7 +12,7 @@ services: networks: - cassandra-net healthcheck: - test: ["CMD", "cqlsh", "-e", "describe keyspaces"] + test: ["CMD", "cqlsh", "-u", "cassandra", "-p", "cassandra", "-e", "describe keyspaces"] interval: 30s timeout: 10s retries: 5 diff --git a/docker-compose/cassandra/v5/docker-compose.yaml b/docker-compose/cassandra/v5/docker-compose.yaml index 282b77f60fb..f407b2d3550 100644 --- a/docker-compose/cassandra/v5/docker-compose.yaml +++ b/docker-compose/cassandra/v5/docker-compose.yaml @@ -1,6 +1,7 @@ services: cassandra: image: cassandra:5.0 + container_name: "cassandra-5" ports: - "9042:9042" - "9160:9160" @@ -11,7 +12,7 @@ services: networks: - cassandra-net healthcheck: - test: ["CMD", "cqlsh", "-e", "describe keyspaces"] + test: ["CMD", "cqlsh", "-u", "cassandra", "-p", "cassandra", "-e", "describe keyspaces"] interval: 30s timeout: 10s retries: 5 diff --git a/docker-compose/monitor/README.md b/docker-compose/monitor/README.md index 2dfc46e9e9a..1d555de4880 100644 --- a/docker-compose/monitor/README.md +++ b/docker-compose/monitor/README.md @@ -81,7 +81,7 @@ docker compose -f docker-compose-v2.yml up **Tips:** - Let the application run for a couple of minutes to ensure there is enough time series data to plot in the dashboard. - Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint. -- To visualize the raw metrics stored on the Prometheus server (for debugging and local development use cases), use the built-in Prometheus UI at http://localhost:9090/graph. For example, http://localhost:9090/graph?g0.expr=traces_span_metrics_calls_total&g0.tab=0&g0.range_input=5m +- To visualize the raw metrics stored on the Prometheus server (for debugging and local development use cases), use the built-in Prometheus UI at http://localhost:9090/query. For example, http://localhost:9090/query?g0.expr=traces_span_metrics_calls_total&g0.tab=0&g0.range_input=5m **Warning:** The included [docker-compose.yml](./docker-compose.yml) file uses the `latest` version of Jaeger and other components. If your local Docker registry already contains older versions, which may still be tagged as `latest`, you may want to delete those images before running the full set, to ensure consistent behavior: diff --git a/scripts/cassandra-integration-test.sh b/scripts/cassandra-integration-test.sh index 53a547ddb45..9f5e295bc3c 100755 --- a/scripts/cassandra-integration-test.sh +++ b/scripts/cassandra-integration-test.sh @@ -8,6 +8,8 @@ set -euxf -o pipefail export CASSANDRA_USERNAME="cassandra" export CASSANDRA_PASSWORD="cassandra" success="false" +timeout=600 +end_time=$((SECONDS + timeout)) usage() { echo $"Usage: $0 " @@ -26,6 +28,26 @@ setup_cassandra() { docker compose -f "$compose_file" up -d } +healthcheck_cassandra() { + local cas_version=$1 + local container_name="cassandra-${cas_version}" + # Since the healthcheck in cassandra is done at the interval of 30s + local wait_seconds=30 + + while [ $SECONDS -lt $end_time ]; do + status=$(docker inspect -f '{{ .State.Health.Status }}' "${container_name}") + if [[ ${status} == "healthy" ]]; then + echo "✅ $container_name is healthy" + return 0 + fi + echo "Waiting for $container_name to be healthy. Current status: $status" + sleep $wait_seconds + done + + echo "❌ ERROR: $container_name did not become healthy in time" + exit 1 +} + dump_logs() { local compose_file=$1 echo "::group::🚧 🚧 🚧 Cassandra logs" @@ -74,6 +96,8 @@ run_integration_test() { # shellcheck disable=SC2064 trap "teardown_cassandra ${compose_file}" EXIT + healthcheck_cassandra "${major_version}" + apply_schema "$schema_version" "$primaryKeyspace" apply_schema "$schema_version" "$archiveKeyspace" diff --git a/scripts/spm-integration-test.sh b/scripts/spm-integration-test.sh index 718700294eb..6d1ac395276 100755 --- a/scripts/spm-integration-test.sh +++ b/scripts/spm-integration-test.sh @@ -66,7 +66,7 @@ check_service_health() { wait_for_services() { echo "Waiting for services to be up and running..." check_service_health "Jaeger" "http://localhost:16686" - check_service_health "Prometheus" "http://localhost:9090/graph" + check_service_health "Prometheus" "http://localhost:9090/query" } # Function to validate the service metrics