-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1038 from saschagrunert/tracing
Add tracing integration test
- Loading branch information
Showing
8 changed files
with
139 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
cd "$(dirname "$0")" | ||
|
||
CONTAINER_RUNTIME=$(which podman 2>/dev/null) || CONTAINER_RUNTIME=$(which docker 2>/dev/null) | ||
if [[ -z "$CONTAINER_RUNTIME" ]]; then | ||
echo "Neither docker nor podman found in \$PATH" | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
|
||
export OTLP_CTR=otlp | ||
export JAEGER_CTR=jaeger | ||
export CONTAINER_RUNTIME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
# Global vars to be used | ||
# shellcheck source=env | ||
source "$(dirname "${BASH_SOURCE[0]}")"/env | ||
|
||
"$CONTAINER_RUNTIME" logs "$OTLP_CTR" 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
# Global vars to be used | ||
# shellcheck source=stop | ||
source "$(dirname "${BASH_SOURCE[0]}")"/stop | ||
|
||
JAEGER_IMG="jaegertracing/all-in-one:1.41.0" | ||
OTLP_IMG="otel/opentelemetry-collector:0.70.0" | ||
|
||
echo "Starting $JAEGER_CTR" | ||
"$CONTAINER_RUNTIME" run -d --rm --network host --name "$JAEGER_CTR" "$JAEGER_IMG" | ||
|
||
PORT=14250 | ||
MAX_CNT=100 | ||
for ((i = 0; i <= "$MAX_CNT"; i++)); do | ||
if netstat -tuplen 2>/dev/null | grep -q "$PORT .* LISTEN"; then | ||
break | ||
fi | ||
|
||
if [[ $i == "$MAX_CNT" ]]; then | ||
echo "Giving up" | ||
exit 1 | ||
fi | ||
|
||
echo "Waiting for gRPC port $PORT to listen… ($i)" | ||
sleep 3 | ||
done | ||
|
||
echo "Starting $OTLP_CTR" | ||
"$CONTAINER_RUNTIME" run -d --rm --network host --name "$OTLP_CTR" \ | ||
-v ./otel-collector-config.yaml:/etc/otel-collector-config.yaml \ | ||
"$OTLP_IMG" --config=/etc/otel-collector-config.yaml | ||
|
||
for ((i = 0; i <= "$MAX_CNT"; i++)); do | ||
if ./logs | grep -q '"jaeger", "state": "READY"'; then | ||
break | ||
fi | ||
|
||
if [[ $i == "$MAX_CNT" ]]; then | ||
echo "Giving up" | ||
exit 1 | ||
fi | ||
|
||
echo "Waiting for OTLP to become ready… ($i)" | ||
sleep 3 | ||
done | ||
|
||
echo "Everything is ready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
# Global vars to be used | ||
# shellcheck source=env | ||
source "$(dirname "${BASH_SOURCE[0]}")"/env | ||
|
||
echo "Stopping $JAEGER_CTR and $OTLP_CTR containers" | ||
for CTR in "$JAEGER_CTR" "$OTLP_CTR"; do | ||
"$CONTAINER_RUNTIME" stop "$CTR" >/dev/null 2>&1 || true | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters