Skip to content

Commit

Permalink
Use jaeger-v2 by default in Hotrod and Monitor examples (#6523)
Browse files Browse the repository at this point in the history
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! πŸ‘‹πŸŽ‰
-->

## Which problem is this PR solving?
-  Resolves #6520 

## Description of the changes
- Rename docker-compose.yml to docker-compose-v1.yml
- update reference: script, doc, github actions, makefile

## How was this change tested?
- 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: zzzk1 <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
zzzk1 and yurishkuro authored Jan 13, 2025
1 parent 441c274 commit 5ccbc2d
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 96 deletions.
14 changes: 7 additions & 7 deletions docker-compose/monitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

BINARY ?= all-in-one # Default value uses v1 binary
BINARY ?= jaeger # Default value uses v2 binary

.PHONY: build
build: clean-jaeger
Expand All @@ -20,13 +20,13 @@ build: clean-jaeger
.PHONY: dev
dev: export JAEGER_IMAGE_TAG = dev
dev:
docker compose -f docker-compose.yml up $(DOCKER_COMPOSE_ARGS)
docker compose up $(DOCKER_COMPOSE_ARGS)

.PHONY: dev-v2
dev-v2: export JAEGER_IMAGE_TAG = dev
dev-v2: export BINARY = jaeger
dev-v2: build
docker compose -f docker-compose-v2.yml up $(DOCKER_COMPOSE_ARGS)
.PHONY: dev-v1
dev-v1: export JAEGER_IMAGE_TAG = dev
dev-v1: export BINARY = all-in-one
dev-v1: build
docker compose -f docker-compose-v1.yml up $(DOCKER_COMPOSE_ARGS)

.PHONY: clean-jaeger
clean-jaeger:
Expand Down
14 changes: 7 additions & 7 deletions docker-compose/monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ It uses the latest image tags from both Jaeger and OpenTelemetry.
docker compose up
```

**Jaeger v2**
**Jaeger v1**

```shell
docker compose -f docker-compose-v2.yml up
docker compose -f docker-compose-v1.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/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` files use 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,13 +92,13 @@ 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=2.0.0 docker compose -f docker-compose.yml up
```

or for Jaeger v2:
or for Jaeger v1:

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

## Development
Expand All @@ -107,7 +107,7 @@ These steps allow for running the system necessary for SPM, built from Jaeger's

The primary use case is for testing source code changes to the SPM feature locally.

### Build jaeger-all-in-one docker image
### Build jaeger-v2 docker image

```shell
make build
Expand Down
54 changes: 54 additions & 0 deletions docker-compose/monitor/docker-compose-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
services:
jaeger:
networks:
- backend
image: jaegertracing/all-in-one:${JAEGER_IMAGE_TAG:-latest}
volumes:
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json"
command: --query.ui-config /etc/jaeger/jaeger-ui.json
environment:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-}
- PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-}
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
ports:
- "16686:16686"

otel_collector:
networks:
backend:
# This is the host name used in Prometheus scrape configuration.
aliases: [spm_metrics_source]
image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.112.0}
volumes:
- ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml
command: --config /etc/otelcol/otel-collector-config.yml
depends_on:
- jaeger
ports:
- "8889:8889"

microsim:
networks:
- backend
image: yurishkuro/microsim:v0.4.1
command: "-d 24h -s 500ms"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel_collector:4318
- OTEL_EXPORTER_OTLP_INSECURE=true
depends_on:
- otel_collector

prometheus:
networks:
- backend
image: prom/prometheus:latest
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"

networks:
backend:
39 changes: 0 additions & 39 deletions docker-compose/monitor/docker-compose-v2.yml

This file was deleted.

37 changes: 11 additions & 26 deletions docker-compose/monitor/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,35 @@
services:
jaeger:
networks:
- backend
image: jaegertracing/all-in-one:${JAEGER_IMAGE_TAG:-latest}
volumes:
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json"
command: --query.ui-config /etc/jaeger/jaeger-ui.json
environment:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
- PROMETHEUS_QUERY_NAMESPACE=${PROMETHEUS_QUERY_NAMESPACE:-}
- PROMETHEUS_QUERY_DURATION_UNIT=${PROMETHEUS_QUERY_DURATION_UNIT:-}
- PROMETHEUS_QUERY_NORMALIZE_CALLS=true
- PROMETHEUS_QUERY_NORMALIZE_DURATION=true
ports:
- "16686:16686"

otel_collector:
networks:
backend:
# This is the host name used in Prometheus scrape configuration.
aliases: [spm_metrics_source]
image: otel/opentelemetry-collector-contrib:${OTEL_IMAGE_TAG:-0.112.0}
image: jaegertracing/jaeger:${JAEGER_IMAGE_TAG:-latest}
volumes:
- ${OTEL_CONFIG_SRC:-./otel-collector-config-connector.yml}:/etc/otelcol/otel-collector-config.yml
command: --config /etc/otelcol/otel-collector-config.yml
depends_on:
- jaeger
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json" # Do we need this for v2 ? Seems to be running without this.
- "../../cmd/jaeger/config-spm.yaml:/etc/jaeger/config.yml"
command: ["--config", "/etc/jaeger/config.yml"]
ports:
- "16686:16686"
- "8888:8888"
- "8889:8889"
- "4317:4317"
- "4318:4318"

microsim:
networks:
- backend
image: yurishkuro/microsim:v0.4.1
command: "-d 24h -s 500ms"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel_collector:4318
- OTEL_EXPORTER_OTLP_INSECURE=true
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://jaeger:4318/v1/traces
depends_on:
- otel_collector
- jaeger

prometheus:
networks:
- backend
image: prom/prometheus:latest
image: prom/prometheus:v3.1.0
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# To run a specific version of Jaeger, use environment variable, e.g.:
# JAEGER_VERSION=2.0.0 HOTROD_VERSION=1.63.0 docker compose up
# JAEGER_VERSION=1.52 docker compose up

services:
jaeger:
image: ${REGISTRY:-}jaegertracing/jaeger:${JAEGER_VERSION:-latest}
image: ${REGISTRY:-}jaegertracing/all-in-one:${JAEGER_VERSION:-latest}
ports:
- "16686:16686"
- "4317:4317"
Expand All @@ -14,7 +14,7 @@ services:
- jaeger-example

hotrod:
image: ${REGISTRY:-}jaegertracing/example-hotrod:${HOTROD_VERSION:-latest}
image: ${REGISTRY:-}jaegertracing/example-hotrod:${JAEGER_VERSION:-latest}
# To run the latest trunk build, find the tag at Docker Hub and use the line below
# https://hub.docker.com/r/jaegertracing/example-hotrod-snapshot/tags
#image: jaegertracing/example-hotrod-snapshot:0ab8f2fcb12ff0d10830c1ee3bb52b745522db6c
Expand Down
6 changes: 3 additions & 3 deletions examples/hotrod/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# To run a specific version of Jaeger, use environment variable, e.g.:
# JAEGER_VERSION=1.52 docker compose up
# JAEGER_VERSION=2.0.0 HOTROD_VERSION=1.63.0 docker compose up

services:
jaeger:
image: ${REGISTRY:-}jaegertracing/all-in-one:${JAEGER_VERSION:-latest}
image: ${REGISTRY:-}jaegertracing/jaeger:${JAEGER_VERSION:-latest}
ports:
- "16686:16686"
- "4317:4317"
Expand All @@ -14,7 +14,7 @@ services:
- jaeger-example

hotrod:
image: ${REGISTRY:-}jaegertracing/example-hotrod:${JAEGER_VERSION:-latest}
image: ${REGISTRY:-}jaegertracing/example-hotrod:${HOTROD_VERSION:-latest}
# To run the latest trunk build, find the tag at Docker Hub and use the line below
# https://hub.docker.com/r/jaegertracing/example-hotrod-snapshot/tags
#image: jaegertracing/example-hotrod-snapshot:0ab8f2fcb12ff0d10830c1ee3bb52b745522db6c
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"
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,11 +54,11 @@ 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)
docker_compose_file="./examples/hotrod/docker-compose-v2.yml"
docker_compose_file="./examples/hotrod/docker-compose.yml"
binary="jaeger"
;;
*)
Expand Down
12 changes: 6 additions & 6 deletions scripts/e2e/spm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ 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'
BINARY='jaeger'
compose_file=docker-compose/monitor/docker-compose.yml

while getopts "b:h" opt; do
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 Expand Up @@ -161,9 +161,9 @@ teardown_services() {

main() {
if [ "$BINARY" == "jaeger" ]; then
(cd docker-compose/monitor && make build BINARY="$BINARY" && make dev-v2 DOCKER_COMPOSE_ARGS="-d")
else
(cd docker-compose/monitor && make build BINARY="$BINARY" && make dev DOCKER_COMPOSE_ARGS="-d")
else
(cd docker-compose/monitor && make build BINARY="$BINARY" && make dev-v1 DOCKER_COMPOSE_ARGS="-d")
fi
wait_for_services
check_spm
Expand Down

0 comments on commit 5ccbc2d

Please sign in to comment.