Skip to content

Commit

Permalink
[Enhancement] Hotrod and Monitor Use Docker Compose V2 as Default
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzk1 committed Jan 11, 2025
1 parent 980dc31 commit 1ad5347
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docker-compose/monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build: clean-jaeger
.PHONY: dev
dev: export JAEGER_IMAGE_TAG = dev
dev:
docker compose -f docker-compose.yml up $(DOCKER_COMPOSE_ARGS)
docker compose -f docker-compose-v1.yml up $(DOCKER_COMPOSE_ARGS)

.PHONY: dev-v2
dev-v2: export JAEGER_IMAGE_TAG = dev
Expand Down
8 changes: 4 additions & 4 deletions docker-compose/monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This brings up the system necessary to use the SPM feature locally.
It uses the latest image tags from both Jaeger and OpenTelemetry.

```shell
docker compose up
docker compose -f docker-compose-v1.yml up
```

**Jaeger v2**
Expand All @@ -83,7 +83,7 @@ docker compose -f docker-compose-v2.yml up
- 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/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:
**Warning:** The included [docker-compose-v1.yml](./docker-compose-v1.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:

```bash
make clean-all
Expand All @@ -92,7 +92,7 @@ make clean-all
To use an official published image of Jaeger, specify the version via environment variable:

```shell
JAEGER_IMAGE_TAG=1.62.0 docker compose up
JAEGER_IMAGE_TAG=1.62.0 docker compose -f docker-compose-v1.yml up
```

or for Jaeger v2:
Expand Down Expand Up @@ -126,7 +126,7 @@ to emit traces to the OpenTelemetry Collector which, in turn, will aggregate the

Start the local stack needed for SPM, if not already done:
```shell
docker compose up
docker compose -f docker-compose-v2.yml up
```

Generate a specific number of traces with:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/hotrod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ As of Jaeger v1.42.0 this application was upgraded to use the OpenTelemetry SDK

### Run everything via `docker compose`

* Download `docker-compose.yml` from https://github.com/jaegertracing/jaeger/blob/main/examples/hotrod/docker-compose.yml
* Download `docker-compose-v1.yml` from https://github.com/jaegertracing/jaeger/blob/main/examples/hotrod/docker-compose-v1.yml
* Optional: find the latest Jaeger version (see https://www.jaegertracing.io/download/) and pass it via environment variable `JAEGER_VERSION`. Otherwise `docker compose` will use the `latest` tag, which is fine for the first time you download the images, but once they are in your local registry the `latest` tag is never updated and you may be running stale (and possibly incompatible) verions of Jaeger and the HotROD app.
* Run Jaeger backend and HotROD demo, e.g.:
* `JAEGER_VERSION=1.52 docker compose -f path-to-yml-file up`
Expand Down
10 changes: 5 additions & 5 deletions scripts/build/build-hotrod-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ print_help() {
echo "-l: Enable local-only mode that only pushes images to local registry"
echo "-o: overwrite image in the target remote repository even if the semver tag already exists"
echo "-p: Comma-separated list of platforms to build for (default: all supported)"
echo "-v: Jaeger version to use for hotrod image (v1 or v2, default: v1)"
echo "-v: Jaeger version to use for hotrod image (v1 or v2, default: v2)"
echo "-r: Runtime to test with (docker|k8s, default: docker)"
exit 1
}

docker_compose_file="./examples/hotrod/docker-compose.yml"
docker_compose_file="./examples/hotrod/docker-compose-v2.yml"
platforms="$(make echo-linux-platforms)"
current_platform="$(go env GOOS)/$(go env GOARCH)"
jaeger_version="v1"
binary="all-in-one"
jaeger_version="v2"
binary="jaeger"
FLAGS=()
success="false"
runtime="docker"
Expand Down Expand Up @@ -54,7 +54,7 @@ done

case "$jaeger_version" in
v1)
docker_compose_file="./examples/hotrod/docker-compose.yml"
docker_compose_file="./examples/hotrod/docker-compose-v1.yml"
binary="all-in-one"
;;
v2)
Expand Down
10 changes: 5 additions & 5 deletions scripts/e2e/spm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ set -euf -o pipefail

print_help() {
echo "Usage: $0 [-b binary]"
echo "-b: Which binary to build: 'all-in-one' (default) or 'jaeger' (v2)"
echo "-b: Which binary to build: 'all-in-one' or 'jaeger' (v2) (default)"
echo "-h: Print help"
exit 1
}

BINARY='all-in-one'
compose_file=docker-compose/monitor/docker-compose.yml
BINARY='jaeger'
compose_file=docker-compose/monitor/docker-compose-v2.yml

while getopts "b:h" opt; do
case "${opt}" in
Expand All @@ -28,8 +28,8 @@ done

set -x

if [ "$BINARY" == "jaeger" ]; then
compose_file=docker-compose/monitor/docker-compose-v2.yml
if [ "$BINARY" == "all-in-one" ]; then
compose_file=docker-compose/monitor/docker-compose-v1.yml
fi

timeout=600
Expand Down

0 comments on commit 1ad5347

Please sign in to comment.