Skip to content

Commit

Permalink
chore(examples): Updating vendor examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Aug 14, 2024
1 parent 5de89bf commit 3b8bb2b
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 104 deletions.
11 changes: 0 additions & 11 deletions examples/quick-start-jaeger-nodejs/tracetest-tracing-backend.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"

LIGHTSTEP_ACCESS_TOKEN="<YOUR_LIGHTSTEP_ACCESS_TOKEN>"

# Collector
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
Expand Down
1 change: 1 addition & 0 deletions examples/tracetest-lightstep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
11 changes: 11 additions & 0 deletions examples/tracetest-lightstep/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"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ exporters:
logLevel: debug
# OTLP for Tracetest
otlp/tracetest:
endpoint: tracetest:4317 # Send traces to Tracetest. Read more in docs here: https://docs.tracetest.io/configuration/connecting-to-data-stores/opentelemetry-collector
endpoint: tracetest-agent:4317
tls:
insecure: true
# OTLP for Lightstep
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
"lightstep-access-token": "<lightstep_access_token>" # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start
"lightstep-access-token": ${env:LIGHTSTEP_ACCESS_TOKEN} # Send traces to Lightstep. Read more in docs here: https://docs.lightstep.com/otel/otel-quick-start

service:
pipelines:
Expand Down
73 changes: 72 additions & 1 deletion examples/tracetest-lightstep/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,52 @@
# OpenTelemetry Demo
# OpenTelemetry Demo
# https://github.com/open-telemetry/opentelemetry-demo

version: "3.2"
services:
# 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:
otel-frontend:
condition: service_healthy
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

cache:
image: redis:6
restart: unless-stopped
Expand Down Expand Up @@ -114,6 +158,11 @@ services:
- otel-recommendationservice
- otel-shippingservice
- otel-collector
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:8084"]
interval: 1s
timeout: 3s
retries: 60

# PaymentService
otel-paymentservice:
Expand Down Expand Up @@ -179,3 +228,25 @@ services:
depends_on:
postgres:
condition: service_healthy

postgres:
image: postgres:14
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
healthcheck:
test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
interval: 1s
timeout: 5s
retries: 60

otel-collector:
image: otel/opentelemetry-collector-contrib:0.68.0
restart: unless-stopped
environment:
- LIGHTSTEP_ACCESS_TOKEN
command:
- "--config"
- "/otel-local-config.yaml"
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
17 changes: 17 additions & 0 deletions examples/tracetest-lightstep/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
6 changes: 6 additions & 0 deletions examples/tracetest-lightstep/resources/datastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: DataStore
spec:
id: current
name: Lightstep
type: lightstep
16 changes: 16 additions & 0 deletions examples/tracetest-lightstep/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
File renamed without changes.
50 changes: 0 additions & 50 deletions examples/tracetest-lightstep/tracetest/docker-compose.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions examples/tracetest-lightstep/tracetest/tracetest-config.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions examples/tracetest-lightstep/tracetest/tracetest-provision.yaml

This file was deleted.

0 comments on commit 3b8bb2b

Please sign in to comment.