Send traces
With the OpenTelemetry SDK, set two environment variables:
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.idorgen_ai.conversation.idon 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(ordeployment.environment) names the trace’s environment. The Traces page andancha traces --envfilter by it, so staging runs stay apart from production ones.
Upload a file
--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.
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.