Tracing

Troubleshooting

The mistakes that make a trace wrong or missing, how to spot each one, and the fix.

Turn on debug: true in init first (Python: debug=True). The SDK then logs every send, every error, and every instrumentor it couldn't load.

Common mistakes

Each of these produces a trace that looks fine but is wrong:

You seeCauseFix
One user question makes several runsA wrapAgent around each sub-agent, tool or model callWrap only the entry point; sub-agents are agent spans. Multi-agent
One run holds a whole chat sessionOne run kept open across turnsOne run per turn, grouped by conversationId. Conversations
Blank input, or output like { status: 'ok' }setInput not called; the HTTP response or a stream handle set as outputSet the user's message and the final answer. Wrap your agent
Users all show as anon_...No distinctId, or a different one per servicePass your stable user ID everywhere. Users
Turns don't groupNo conversationId on some turnsPass the thread ID on every turn
A run with no model calls under itModel client created before init, or instrumentor not installedCall init in the first module your app loads. Frameworks
Model calls or tokens counted twiceTwo instrumentors on one call, or trodo.llm around an auto-captured callKeep one. Frameworks
Failures show as greenErrors caught and returned as dataCall setError (span) or setErrorSummary (run). Status & errors
A tool never shows upawait trodo.tool(name, fn): the helper was created, never calledCall the function tool() returns. Manual spans
MCP calls stuck as running runswrapAgent or startRun around tools/callUse trackMcp. Trace your MCP server
Nothing arrives from a script or jobThe process exited before sendingawait trodo.flush() before exit. Delivery & runtimes

Questions

Still stuck? Email developers@trodo.ai.

On this page