Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples/docs): Updating jaeger x node.js example to be the initial template #3958

Merged
merged 4 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
371 changes: 17 additions & 354 deletions docs/docs/examples-tutorials/recipes/running-tracetest-with-jaeger.mdx

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions examples/quick-start-jaeger-nodejs/.env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
TRACETEST_API_KEY="<YOUR_TRACETEST_API_KEY>"
TRACETEST_API_TOKEN="<YOUR_TRACETEST_TOKEN>"
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"
11 changes: 11 additions & 0 deletions examples/quick-start-jaeger-nodejs/Dockerfile.tracetest
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine

WORKDIR /app
ARG TRACETEST_IMAGE_VERSION=v1.4.0

RUN apk --update add bash jq curl
RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION

WORKDIR /resources

ENTRYPOINT ["echo", "Tracetest CLI installed"]
28 changes: 0 additions & 28 deletions examples/quick-start-jaeger-nodejs/docker-compose.agent.yaml

This file was deleted.

72 changes: 72 additions & 0 deletions examples/quick-start-jaeger-nodejs/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,75 @@ services:
build: .
ports:
- "8080:8080"
depends_on:
jaeger:
condition: service_healthy
otel-collector:
condition: service_started

otel-collector:
image: otel/opentelemetry-collector-contrib:0.100.0
command:
- "--config"
- "/otel-local-config.yaml"
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
depends_on:
jaeger:
condition: service_healthy

jaeger:
image: jaegertracing/all-in-one:latest
ports:
- 14250:14250
- 16685:16685
- 16686:16686
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:16686"]
interval: 1s
timeout: 3s
retries: 60

# Cloud-based Managed Tracetest
tracetest-agent:
image: kubeshop/tracetest-agent:latest
environment:
# Get the required information here: https://app.tracetest.io/retrieve-token
- TRACETEST_API_KEY=${TRACETEST_TOKEN}
- TRACETEST_ENVIRONMENT_ID=${TRACETEST_ENVIRONMENT_ID}

tracetest-apply:
build:
dockerfile: Dockerfile.tracetest
volumes:
- ./resources:/resources
environment:
TRACETEST_TOKEN: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
entrypoint:
- bash
- /resources/apply.sh
networks:
default: null
depends_on:
app:
condition: service_started
tracetest-agent:
condition: service_started

tracetest-run:
build:
dockerfile: Dockerfile.tracetest
volumes:
- ./resources:/resources
environment:
TRACETEST_TOKEN: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
entrypoint:
- bash
- /resources/run.sh
networks:
default: null
depends_on:
tracetest-apply:
condition: service_completed_successfully
17 changes: 17 additions & 0 deletions examples/quick-start-jaeger-nodejs/resources/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -e

TOKEN=$TRACETEST_TOKEN
ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID

apply() {
echo "Configuring TraceTest"
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID

echo "Applying Resources"
tracetest apply datastore -f /resources/datastore.yaml
tracetest apply test -f /resources/test.yaml
}

apply
12 changes: 12 additions & 0 deletions examples/quick-start-jaeger-nodejs/resources/datastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: DataStore
spec:
id: current
name: jaeger
type: jaeger
default: true
jaeger:
endpoint: jaeger:16685
headers:
"": ""
tls:
insecure: true
16 changes: 16 additions & 0 deletions examples/quick-start-jaeger-nodejs/resources/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

set -e

TOKEN=$TRACETEST_TOKEN
ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID

run() {
echo "Configuring Tracetest"
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID

echo "Running Trace-Based Tests..."
tracetest run test -f /resources/test.yaml
}

run
62 changes: 0 additions & 62 deletions examples/quick-start-jaeger-nodejs/tracetest/docker-compose.yaml

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions examples/quick-start-jaeger-nodejs/tracetest/tracetest.config.yaml

This file was deleted.

Loading