Write and run trace-based tests with Tracetest to assert on span attributes and latency across a distributed system

domain: docs.tracetest.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install Tracetest CLI (tracetest) and deploy the Tracetest server, connecting it to your existing trace backend (Jaeger, Tempo, or an OTLP-compatible store) via the tracetest configure command
  2. Create a test definition YAML file with a trigger section (HTTP request details) and a specs section containing span selectors and assertions
  3. Write span selectors using the Selector Language, e.g., span[tracetest.span.type='http' name='POST /orders'] to target specific spans by type, name, or attribute
  4. Add assertions under each selector, such as attr:http.status_code = 200 or attr:tracetest.span.duration <= 500ms, to validate both correctness and performance
  5. Run the test with tracetest run test -f my-test.yaml; Tracetest triggers the request, waits for the trace, and evaluates all assertions, reporting pass/fail per span
  6. Integrate into CI by adding tracetest run test to your pipeline; use --output junit to produce JUnit XML results compatible with most CI reporting tools

Known gotchas

Related routes

Write and run trace-based tests against a distributed system using Tracetest
docs.tracetest.io · 6 steps · unrated
Configure Grafana Tempo's metrics-generator to produce service-graph and span metrics from ingested traces
grafana.com · 6 steps · unrated
Write TraceQL queries in Grafana Tempo to filter traces by span attributes, duration, and status across nested spans
grafana.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans