Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
383 changes: 383 additions & 0 deletions docs/docs/tools-and-integrations/artillery-engine.mdx

Large diffs are not rendered by default.

433 changes: 433 additions & 0 deletions docs/docs/tools-and-integrations/artillery-plugin.mdx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/docs/tools-and-integrations/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ Tracetest can be integrated and used with other tools. See below which integrati

- [K6](/tools-and-integrations/k6) is a powerful tool to run load tests against any type of services (REST, GRPC, GraphQL, etc). It is widely used by Developers, Site Reliability Engineers and Software Engineers in Test/QA teams to find potential issues when testing real life scenarios in both controlled environments and production.

- [Artillery](/tools-and-integrations/artillery-plugin) is a modern, powerful load-testing toolkit. Artillery is designed to help developers and testers simulate traffic to their applications, APIs, and microservices. It allows users to define scenarios to test how their systems behave under different loads.

- [Testkube](/tools-and-integrations/testkube) is a Kubernetes-native testing framework for Testers and Developers that allows you to automate the executions of your existing testing tools inside your Kubernetes cluster, removing all the complexity from your CI/CD/GitOps pipelines.
10 changes: 10 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ const sidebars = {
id: "tools-and-integrations/keptn",
label: "Keptn",
},
{
type: "doc",
id: "tools-and-integrations/artillery-plugin",
label: "Artillery Plugin",
},
{
type: "doc",
id: "tools-and-integrations/artillery-engine",
label: "Artillery Engine",
},
{
type: "doc",
id: "tools-and-integrations/k6",
Expand Down
1 change: 1 addition & 0 deletions examples/quick-start-artillery/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TRACETEST_AGENT_API_KEY=
2 changes: 2 additions & 0 deletions examples/quick-start-artillery/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
5 changes: 5 additions & 0 deletions examples/quick-start-artillery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Tracetest + Artillery

> [Read the detailed recipe for setting up Tracetest + Artillery in our documentation.](https://docs.tracetest.io/tools-and-integrations/artillery)

This is a quick start showing how you can create programs to run trace-based tests from your Artillery setup utilizing the tracetest engine and plugin. The example shows how to define the Tracetest tests, execute them, and wait for results to be ready. [Read the Typescript Quick Start Docs](https://docs.tracetest.io/tools-and-integrations/artillery) to see how to run this example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is a quick start showing how you can create programs to run trace-based tests from your Artillery setup utilizing the tracetest engine and plugin. The example shows how to define the Tracetest tests, execute them, and wait for results to be ready. [Read the Typescript Quick Start Docs](https://docs.tracetest.io/tools-and-integrations/artillery) to see how to run this example.
This is a quick start showing how you can create programs to run trace-based tests from your Artillery setup utilizing the tracetest engine and plugin. The example shows how to define the Tracetest tests, execute them, and wait for the results to be ready.

31 changes: 31 additions & 0 deletions examples/quick-start-artillery/collector.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
receivers:
otlp:
protocols:
grpc:
http:

processors:
batch:

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

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [logging, jaeger]
traces/1:
receivers: [otlp]
processors: [batch]
exporters: [otlp/trace]
145 changes: 145 additions & 0 deletions examples/quick-start-artillery/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
version: "3.5"
name: pokeshop

services:
tracetest-agent:
environment:
TRACETEST_API_KEY: ${TRACETEST_AGENT_API_KEY}
image: kubeshop/tracetest-agent:latest
networks:
default: null

# pokeshop demo services
postgres:
image: postgres:14
ports:
- 5434:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 1s
timeout: 5s
retries: 60

cache:
image: redis:6
ports:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 60

queue:
image: rabbitmq:3.12
restart: unless-stopped
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: rabbitmq-diagnostics -q check_running
interval: 1s
timeout: 5s
retries: 60

otel-collector:
image: otel/opentelemetry-collector-contrib:0.59.0
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- 4317:4317
- 4318:4318
command:
- "--config"
- "/otel-local-config.yaml"
volumes:
- ./collector.config.yaml:/otel-local-config.yaml
environment:
- JAEGER_ENDPOINT=jaeger:14250
depends_on:
jaeger:
condition: service_healthy

api:
image: kubeshop/demo-pokemon-api:latest
restart: unless-stopped
pull_policy: always
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
NPM_RUN_COMMAND: api
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:8081"]
interval: 1s
timeout: 3s
retries: 60
ports:
- 8081:8081
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy

worker:
image: kubeshop/demo-pokemon-api:latest
restart: unless-stopped
pull_policy: always
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
NPM_RUN_COMMAND: worker
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy

rpc:
image: kubeshop/demo-pokemon-api:latest
restart: unless-stopped
pull_policy: always
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
NPM_RUN_COMMAND: rpc
healthcheck:
test: ["CMD", "lsof", "-i", "8082"]
interval: 1s
timeout: 3s
retries: 60
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy

jaeger:
image: jaegertracing/all-in-one:latest
ports:
- 16686:16686
healthcheck:
test: ["CMD", "wget", "--spider", "localhost:16686"]
interval: 1s
timeout: 3s
retries: 60
23 changes: 23 additions & 0 deletions examples/quick-start-artillery/engine-test-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
config:
target: my_target
tracetest:
token: <YOUR_TRACETES_ENV_TOKEN>
phases:
- duration: 2
arrivalRate: 5
engines:
tracetest: {}
scenarios:
- name: tracetest_engine_test
engine: tracetest
flow:
- test:
id: artillery-engine-import-pokemon
runInfo:
variables:
- key: ENDPOINT
value: http://api:8081
- key: POKEMON_ID
value: "6"
- summary:
format: "pretty"
23 changes: 23 additions & 0 deletions examples/quick-start-artillery/engine-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
config:
target: my_target
tracetest:
token: <YOUR_TRACETES_ENV_TOKEN>
phases:
- duration: 1
arrivalRate: 1
engines:
tracetest: {}
scenarios:
- name: tracetest_engine_test
engine: tracetest
flow:
- test:
definition: import-pokemon.yaml
runInfo:
variables:
- key: ENDPOINT
value: http://api:8081
- key: POKEMON_ID
value: "6"
- summary:
format: "pretty"
28 changes: 28 additions & 0 deletions examples/quick-start-artillery/import-pokemon-trace-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
type: Test
spec:
id: artillery-plugin-import-pokemon
name: "Artillery Plugin: Import a Pokemon"
trigger:
type: traceid
traceid:
id: ${var:TRACE_ID}
specs:
- selector: span[tracetest.span.type="general" name = "validate request"] span[tracetest.span.type="http"]
name: "All HTTP Spans: Status code is 200"
assertions:
- attr:http.status_code = 200
- selector: span[tracetest.span.type="http" name="GET" http.method="GET"]
assertions:
- attr:http.route = "/api/v2/pokemon/${var:POKEMON_ID}"
- selector: span[tracetest.span.type="database"]
name: "All Database Spans: Processing time is less than 1s"
assertions:
- attr:tracetest.span.duration < 1s
- selector: span[tracetest.span.type="http" name="post" http.method="POST"]
name: Response time should be fast
assertions:
- attr:response.time.ms < 100
outputs:
- name: DATABASE_POKEMON_ID
selector: span[tracetest.span.type="database" name="create postgres.pokemon" db.system="postgres" db.name="postgres" db.user="postgres" db.operation="create" db.sql.table="pokemon"]
value: attr:db.result | json_path '$.id'
29 changes: 29 additions & 0 deletions examples/quick-start-artillery/import-pokemon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
type: Test
spec:
id: artillery-engine-import-pokemon
name: "Artillery Engine: Import Pokemon"
trigger:
type: http
httpRequest:
method: POST
url: ${var:ENDPOINT}/pokemon/import
body: '{"id": ${var:POKEMON_ID}}'
headers:
- key: Content-Type
value: application/json
specs:
- selector: span[tracetest.span.type="general" name = "validate request"] span[tracetest.span.type="http"]
name: "All HTTP Spans: Status code is 200"
assertions:
- attr:http.status_code = 200
- selector: span[tracetest.span.type="http" name="GET" http.method="GET"]
assertions:
- attr:http.route = "/api/v2/pokemon/${var:POKEMON_ID}"
- selector: span[tracetest.span.type="database"]
name: "All Database Spans: Processing time is less than 1s"
assertions:
- attr:tracetest.span.duration < 1s
outputs:
- name: DATABASE_POKEMON_ID
selector: span[tracetest.span.type="database" name="create postgres.pokemon" db.system="postgres" db.name="postgres" db.user="postgres" db.operation="create" db.sql.table="pokemon"]
value: attr:db.result | json_path '$.id'
Loading