Quick Start
This page showcases getting started with Tracetest by using the Tracetest CLI, Docker, or Kubernetes.
You need to add OpenTelemetry instrumentation to your code and configure sending traces to a trace data store, or Tracetest directly, to benefit for Tracetest's trace-based testing.
Install the Tracetest CLI
- MAC
- LINUX
- WINDOWS
brew install kubeshop/tracetest/tracetest
curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash
choco source add --name=kubeshop_repo --source=https://chocolatey.kubeshop.io/chocolatey ; choco install tracetest
Install the Tracetest server
tracetest server install
- Docker Compose
- Kubernetes
How do you want to run TraceTest? [type to search]:
> Using Docker Compose
Using Kubernetes
Follow the prompts and continue with all the default settings.
This will generate a ./tracetest/
directory that contains a docker-compose.yaml
and two more config files. One for Tracetest and one for OpenTelemetry collector.
To see the output of this command, view this sample setup from our GitHub examples.
Start Docker Compose from the directory where you ran tracetest server install
.
docker compose -f tracetest/docker-compose.yaml up -d
Starting tracetest ...
...
2022/11/28 18:24:09 HTTP Server started
...
How do you want to run TraceTest? [type to search]:
Using Docker Compose
> Using Kubernetes
Follow the prompts and continue with all the default settings. This will deploy all resources to Kubernetes. To see exactly what is deployed, view the deployment instructions in the Deployment section of the docs.
export POD_NAME=$(kubectl get pods --namespace demo -l "app.kubernetes.io/name=pokemon-api,app.kubernetes.io/instance=demo" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace demo $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace demo port-forward $POD_NAME 8080:$CONTAINER_PORT
kubectl --kubeconfig <path-to-your-home>/.kube/config --context <your-cluster-context> --namespace tracetest port-forward svc/tracetest 11633
Open your browser on http://localhost:11633
.
Create a test.
Need more detailed information about how to install Tracetest? Read the detailed setup on the CLI installation page.
View deployment instructions for Docker and Kubernetes in the Deployment section.
Running a test against localhost
will resolve as 127.0.0.1
inside the Tracetest container. To run tests against apps running on your local machine, add them to the same network and use service name mapping instead. Example: Instead of running an app on localhost:8080
, add it to your Docker Compose file, connect it to the same network as your Tracetest service, and use service-name:8080
in the URL field when creating an app.
You can reach services running on your local machine using:
- Linux (docker version < 20.10.0):
172.17.0.1:8080
- MacOS (docker version >= 18.03) and Linux (docker version >= 20.10.0):
host.docker.internal:8080