Bundled together they form a trace – a structured replay of what happened, step‑by‑step.
The full schema lives in API ▸ Ingestion.
Understanding testId and traceId
Two IDs appear on trace events — here’s what each one does:
Do not set
traceId equal to testId. They serve different purposes: testId links the trace to an Avido test run for evaluation, while traceId groups events together into a single trace.Recommended workflow
- Collect events in memory as they happen.
- Flush once at the end (or on fatal error).
- Add a
logevent describing the error if things blow up. - Keep tracing async – never block your user.
- Evaluation‑only mode? Only ingest when the run came from an Avido test → check for
testIdfrom the Webhook. - LLM events should contain the raw prompt & completion – strip provider JSON wrappers.
SDK installation
Ingesting events
You can send events:- Directly via HTTP
- Via our SDKs (Node:
@avidoai/sdk-node, Python:avido)
When authenticating with an API key, include both the
x-api-key and x-application-id
headers. The application ID should match the application that owns the key so the
request can be authorized.Tip: map your IDs
If you already track a conversation / run in your own DB, pass that same ID asreferenceId.It makes liftover between your system and Avido effortless.
Event types in depth
Every call toclient.ingest.create() accepts an array of events.
The first event is usually a trace (the root container), followed by one or more step events.
trace — root container
Every ingestion batch should start with a trace event. It groups all subsequent steps together.
llm — LLM calls
Track every call to a language model. Use event: "start" when the call begins and event: "end" when it completes, or send a single event with both input and output after the call finishes.
Send the raw prompt and completion values. Strip any provider-specific JSON wrappers so Avido can display and evaluate them consistently.
tool — function / tool calls
Log every tool or function call your model makes.
retriever — RAG queries
Track retrieval-augmented generation lookups and the chunks they return.
log — everything else
Use log events for system prompts, branching decisions, error details, or anything else worth seeing during debugging.
Full end-to-end example
A complete example capturing a realistic agent run with multiple event types:Fetching traces
Use the SDK to list or retrieve traces for debugging and analysis.Error handling
Wrap your ingestion calls so a tracing failure never crashes your application.Next steps
- Inspect traces in Traces inside the dashboard.
- Already using OpenTelemetry? See the OpenTelemetry Integration guide.
- Set up Webhooks to trigger tests automatically.
- Explore the full schema in the API Reference.