Skip to content

Tracing and analytics

Trace reference: spans and attributes

Every span a chat request records, what each one means, and the attributes you can filter and read.

Reference2 min readUpdated 23 October 2026

Traces are OpenTelemetry spans. Attribute names follow the OpenTelemetry gen_ai.* semantic conventions where they exist. A chat request records these spans; not every request has every span.

Spans

SpanWhat it covers
chat.requestThe whole request: agent, model, status and duration. The root of the trace
auth.validate_userChecking the key
agent.fetchLoading the agent's configuration (cached for a few minutes)
preflight.rate_limitThe agent's requests-per-minute check
preflight.creditsReserving the reply's credit
mcp.discoveryLoading the agent's MCP servers and tools
conversation.start_or_loadCreating a conversation or loading its history
rag.prefetchHybrid search and rerank over the agent's knowledge
agentic.round[n]One round of the model deciding, calling tools and answering
llm.chatThe call to the model provider, with tokens and time to first token
tool.executeOne tool call, with its outcome and timing
synthesis.forcedThe final answer forced after the tool rounds ran out or a call repeated

There is no separate rerank span: reranking happens inside rag.prefetch and shows as its rag.reranked attribute.

Useful attributes

AttributeMeaning
gen_ai.usage.input_tokens, output_tokens, total_tokensTokens for the request
model, providerThe model and provider used
temperature, max tokensThe settings the model was called with
time to first tokenHow long until the first delta, the latency users feel
request.duration_msEnd-to-end duration
request.cost_usdEstimated model cost; only meaningful when token prices are set (see below)
answer.cachedThe answer came from the 15-minute answer cache
rag.*Retrieval scores, whether results were reranked, and how many sources were used
gen_ai.tool.name, tool.success, tool.sourcePer tool call: which tool, whether it worked, and whether it was MCP, knowledge search or a skipped repeat
error.codeThe error code, matching the API's error event
credits.balanceYour credit balance at the time

Cost figures

Model cost is estimated from token prices you set; SentientOne doesn't know your provider's prices. Set input and output prices per million tokens in the agent's Settings to see estimates on its Cost tab. Your provider's bill is the source of truth.

Reading traces from the API

GET /v1/traces lists your recent chat.request root spans; filter with agent_id, from and to (ISO datetimes), status=ok|error, limit (1 to 500, default 50) and offset. GET /v1/traces/{trace_id} returns one trace. Both take your secret key in X-Api-Key.

Traces API
curl "https://api.sentientone.ai/v1/traces?status=error&limit=20" \  -H "X-Api-Key: $SENTIENTONE_API_KEY"curl "https://api.sentientone.ai/v1/traces/$TRACE_ID" \  -H "X-Api-Key: $SENTIENTONE_API_KEY"

Retention

Traces are kept for 90 days, then deleted automatically. Deleting your account removes your agents and conversations at once; traces already recorded expire on the same 90-day schedule.