Skip to main content

Opening Tracetest Core

This page showcases opening the Tracetest Web UI regardless if you used the Tracetest CLI, Docker, Kubernetes, or Helm to install Tracetest Server.

Once you've installed Tracetest, as explained in the installation guide, you access the Tracetest Web UI on http://localhost:11633. Here's what will greet you after a fresh install.

Landing page Tracetest

By following the installation guide your Tracetest Core instance will have a demo Pokeshop app installed that generates distributed traces when triggered.

Creating Trace-based Tests​

You can create tests in two ways:

  • Visually, in the Web UI
  • Programmatically, in YAML

Creating Trace-based Tests Visually​

This guide will show how to create end-to-end and integration tests in less than 5 minutes via the Web UI.

note

To view the in-depth guide on creating tests visually, check out this docs page.

Create​

On the top right, click the Create button and select Create New Test in the drop down.

Create a new test

Select an HTTP Request as the test trigger, and choose the Pokeshop - Import example.

Select Pokeshop example

This will populate a sample API test against a POST endpoint in the Pokeshop app demo. Clicking Create & Run will save and trigger the test.

API test against POST endpoint

info

Running a test against localhost will resolve as 127.0.0.1 inside the Tracetest Core 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

Trigger​

You'll be redirected to the test page where you can see four tabs and depending on which one you select you'll get access to:

  • Test trigger and results
  • The entire distributed trace and trace analysis
  • Test specification and assertions
  • How to automate the test
note

To view the in-depth guide on test results, check out this docs page

The Trigger tab shows how the test was triggered and what the API response was.

test result

Trace​

The Trace tab shows the entire distributed trace for debugging and a trace analysis score.

distributed trace and trace analysis score

Test​

The Test tab shows span attributes. Here you add test specs and assertions on attribute values. You also get a test snippets out-of-the-box for common test cases.

In the sample below, you see how to assert that all database spans return in less than 100ms.

test specs

Automate​

The Automate tab shows how to automate the test run with the Tracetest CLI and other automation options.

automate

From here you can download a YAML file test definition and run it with the CLI.

Creating Trace-based Tests Programatically​

The test definition will contain:

  • The Trigger for the test in the trigger section.
  • The Test Specifications in thespecs section.

You can either download the YAML file test definition, or write one from scratch.

Create​

Using the sample from above, create the Trace-based Test programatically.

pokeshop_import.yaml
type: Test
spec:
id: Yg9sN-94g
name: Pokeshop - Import
description: Import a Pokemon
trigger:
type: http
httpRequest:
url: http://demo-api:8081/pokemon/import
method: POST
headers:
- key: Content-Type
value: application/json
body: '{"id":52}'
specs:
- name: 'All Database Spans: Processing time is less than 100ms'
selector: span[tracetest.span.type="database"]
assertions:
- attr:tracetest.span.duration < 100ms

Trigger​

Using the CLI, trigger a test run.

Terminal
tracetest run test -f pokeshop_import.yaml -o pretty

Output​

The test run will complete and show a result.

Output
✔ Pokeshop - Import (http://localhost:11633/test/Yg9sN-94g/run/3/test)
✔ All Database Spans: Processing time is less than 100ms

The provided link in the test output will open the test run in the Tracetest Web UI.