Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trodo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

My run appears but has zero spans

The LLM call happened outside the wrapAgent callback, or the framework isn’t auto-instrumented.
  • Confirm the LLM client is imported after trodo.init(). The auto-instrumenter hooks require / import; if the module is already loaded, the patch won’t apply.
  • Check the Integrations page for your framework. If it’s not listed, wrap the call manually with trodo.withSpan or use trackLlmCall.
  • Verify with debug: true on trodo.init(...) — the SDK logs every intercepted call.

My spans appear but have zero tokens

The provider returned a response shape Trodo doesn’t recognise. The three built-in shapes are OpenAI (usage.prompt_tokens), Anthropic (usage.input_tokens), and Google (usageMetadata.promptTokenCount). For anything else — Cohere, Bedrock InvokeModel, custom endpoints — pass a custom extractUsage via trodo.llm(...), or use trackLlmCall with inputTokens / outputTokens set explicitly.

Cross-service run loses the connection

The receiving service didn’t read the X-Trodo-Run-Id header.
  • Node/Express: install trodo.expressMiddleware() before your routes.
  • Python/FastAPI: register trodo.fastapi_middleware().
  • Manual: read the header yourself and wrap the handler in trodo.joinRun(runId, fn).
Also confirm the caller attached the headers: fetch(url, { headers: trodo.propagationHeaders() }).

Runs land but dashboard shows “Missing pricing”

The (provider, model) pair isn’t in the internal pricing table yet. Cost stays NULL; tokens and spans are still recorded. Workarounds:
  • Pass cost explicitly on setLlm or trackLlmCall.
  • File a pricing-table request; it’ll be added and new runs will compute correctly.
Existing runs aren’t retroactively repriced.

Spans from a worker thread / ProcessPool are missing

Node worker_threads and Python ThreadPoolExecutor / ProcessPoolExecutor break AsyncLocalStorage / contextvars boundaries. Capture runId in the main thread and pass it to the worker, then use joinRun inside. See Spans outside wrapAgent.

Feedback shows “unknown run”

feedback(runId, ...) was called before the run had finished flushing. The backend reconciles eventually, but the dashboard may briefly show the feedback against a missing run. Wait until wrapAgent has returned before calling feedback.

402 Payment Required in debug logs

You’re over your plan’s event limit for the month. Runs are dropped silently (no thrown errors). Upgrade your plan or wait for the monthly reset. Spans, feedback, embeddings, and retries are never rate-limited — only run ingestion.

Enable debug logging

trodo.init({ siteId: process.env.TRODO_SITE_ID, debug: true });
The SDK logs every intercepted framework call, every span close, every HTTP POST to sdkapi.trodo.ai, and any dropped events with reasons.