Skip to content

Commit

Permalink
updating artillery example
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Aug 15, 2024
1 parent 7f55ed1 commit 1f52eb7
Show file tree
Hide file tree
Showing 13 changed files with 7,509 additions and 1,868 deletions.
6 changes: 4 additions & 2 deletions examples/quick-start-artillery-playwright/.env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
TRACETEST_AGENT_API_KEY=
TRACETEST_API_TOKEN=
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"
1 change: 1 addition & 0 deletions examples/quick-start-artillery-playwright/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
node_modules
dist/
13 changes: 13 additions & 0 deletions examples/quick-start-artillery-playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM mcr.microsoft.com/playwright:v1.45.3

WORKDIR /app

COPY . .

RUN npm install

RUN npm install -g artillery artillery-engine-playwright && \
npm cache clean --force && \
rm -rf /root/.cache && \
rm -rf /ms-playwright/firefox* && \
rm -rf /ms-playwright/webkit*
11 changes: 11 additions & 0 deletions examples/quick-start-artillery-playwright/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"]
16 changes: 3 additions & 13 deletions examples/quick-start-artillery-playwright/collector.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ processors:
batch:

exporters:
logging:
loglevel: debug
jaeger:
endpoint: ${JAEGER_ENDPOINT}
tls:
insecure: true
otlp/trace:
endpoint: tracetest-agent:4317
otlp/jaeger:
endpoint: jaeger:4317
tls:
insecure: true

Expand All @@ -28,8 +22,4 @@ service:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging, jaeger]
traces/1:
receivers: [otlp]
processors: [batch]
exporters: [otlp/trace]
exporters: [otlp/jaeger]
63 changes: 50 additions & 13 deletions examples/quick-start-artillery-playwright/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
version: "3.5"
version: '3.5'
name: pokeshop

services:
tracetest-run:
build: .
volumes:
- ./resources:/app/resources
environment:
TRACETEST_TOKEN: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
depends_on:
tracetest-agent:
condition: service_started
tracetest-apply:
condition: service_completed_successfully
command: npm test

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:
tracetest-agent:
condition: service_started

tracetest-agent:
environment:
TRACETEST_API_KEY: ${TRACETEST_AGENT_API_KEY}
TRACETEST_API_KEY: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
image: kubeshop/tracetest-agent:latest
networks:
default: null
depends_on:
api:
condition: service_healthy

# pokeshop demo services
postgres:
Expand All @@ -19,7 +54,7 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 1s
timeout: 5s
retries: 60
Expand All @@ -29,7 +64,7 @@ services:
ports:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
test: ['CMD', 'redis-cli', 'ping']
interval: 1s
timeout: 3s
retries: 60
Expand All @@ -47,20 +82,18 @@ services:
retries: 60

otel-collector:
image: otel/opentelemetry-collector-contrib:0.59.0
image: otel/opentelemetry-collector-contrib:0.100.0
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
- 'host.docker.internal:host-gateway'
ports:
- 4317:4317
- 4318:4318
command:
- "--config"
- "/otel-local-config.yaml"
- '--config'
- '/otel-local-config.yaml'
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
environment:
- JAEGER_ENDPOINT=jaeger:14250
depends_on:
jaeger:
condition: service_healthy
Expand All @@ -78,13 +111,17 @@ services:
HTTP_COLLECTOR_ENDPOINT: http://localhost:4318/v1/traces
NPM_RUN_COMMAND: api
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:8081"]
test: ['CMD', 'wget', '--spider', 'localhost:8081']
interval: 1s
timeout: 3s
retries: 60
ports:
- 8081:8081
depends_on:
otel-collector:
condition: service_started
worker:
condition: service_started
postgres:
condition: service_healthy
cache:
Expand Down Expand Up @@ -123,7 +160,7 @@ services:
COLLECTOR_ENDPOINT: http://otel-collector:4317
NPM_RUN_COMMAND: rpc
healthcheck:
test: ["CMD", "lsof", "-i", "8082"]
test: ['CMD', 'lsof', '-i', '8082']
interval: 1s
timeout: 3s
retries: 60
Expand All @@ -140,7 +177,7 @@ services:
ports:
- 16686:16686
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:16686"]
test: ['CMD', 'wget', '--spider', 'localhost:16686']
interval: 1s
timeout: 3s
retries: 60
Loading

0 comments on commit 1f52eb7

Please sign in to comment.