Bundled together they form a trace – a structured replay of what happened, step‑by‑step.
| Event | When to use |
|---|---|
trace | The root container for a whole conversation / agent run. |
llm | Start and end of every LLM call. |
tool | Calls to a function / external tool invoked by the model. |
retriever | RAG queries and the chunks they return. |
log | Anything else worth seeing while debugging (system prompts, branches, errors…). |
The full schema lives in API ▸ Ingestion.
Understanding testId and traceId
Two IDs appear on trace events — here’s what each one does:
| Field | Who sets it | When to include |
|---|---|---|
testId | Avido (via webhook) | Only when the trace originates from an Avido test. Pass the testId from the webhook payload. Do not set it for traces that come from real user interactions. |
traceId | You (optional) | Setting traceId client-side is optional — the server generates one automatically if you don’t. If you do set it, use a random UUID and keep the same value across all steps in the trace. |
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.
| Field | Required | Description |
|---|---|---|
type | Yes | Always "trace" |
timestamp | Yes | ISO 8601 timestamp |
referenceId | No | Your own ID for this conversation / run |
traceId | No | Client-provided UUID to identify this trace. Optional — the server generates one if omitted. If set, use the same random UUID for all steps in the trace. |
testId | No | The testId from a webhook payload — links the trace to an Avido test run. Only set this for test-originated traces; omit it for real user interactions. |
metadata | No | Arbitrary key-value pairs for filtering and search |
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.