Skip to main content
Your workspace receives OpenTelemetry traces from your agent and keeps each one as a trace you can save as a test. The guide From a production trace to a failing test walks through the whole flow.

Send traces

With the OpenTelemetry SDK, set two environment variables:
Create ingest keys on the Traces page. An ingest key sends traces to your workspace and does nothing else: it cannot read traces, tests or runs. Revoke a key on the same page; senders still using it are refused within a minute. See Login and API keys.

Limits and answers

An exporter only logs a refused batch. The Traces page says how many batches each ingest key had refused in the last 24 hours, and why.

How spans become a trace

  • Spans with the same trace id are one trace. Ancha assembles it once no span has arrived for 60 seconds.
  • An agent that starts a new trace for every webhook or turn can join them: put the same session.id or gen_ai.conversation.id on a span of each. They become one trace on the Traces page. Spans of those traces that arrive without the attribute follow them.
  • Spans that arrive after a trace was assembled join it. Nothing already stored is replaced.
  • While spans are still arriving, the trace page says so, and you can save a test from what has arrived.
  • If a trace cannot be assembled, it is marked failed with the reason, and its waiting spans are deleted.
  • The resource attribute deployment.environment.name (or deployment.environment) names the trace’s environment. The Traces page and ancha traces --env filter by it, so staging runs stay apart from production ones.

Upload a file

The file can be Ancha Trace IR, an OTLP JSON export, or a Langfuse or LangSmith export, up to 25 MB. --from fetches the trace with the keys in your shell, which never leave your computer. ancha import saves the test it makes and writes it to your project. See ancha import. A saved test takes the agent’s other traces in your workspace (up to five of the same agent) as examples, so answers production never gave are simulated the way the tools behaved in those runs.

The Traces page

Each trace shows:
  • What arrived: the agent’s own tool calls, API calls by tool and whether Ancha rebuilds each tool, webhooks, model calls and whether they carried the agent’s input, and what to add to your tracing for anything missing.
  • The test this trace makes: what the agent is told, the world in plain words, the checks with production’s result, and the questions one trace cannot settle.
  • Save as test, Download what Ancha stored, and Delete trace.
Tests lists the saved tests, one row per trace with its latest version.

API

Read endpoints take an API key (Authorization: Bearer <API key>), the same one ancha login saves. Ids may be shortened to their first eight characters; a trace may also be named by the trace id your tracing tool shows. The base URL is https://app.ancha.io. An id prefix that names two traces answers 409; use more characters.