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.
What auto-instruments
Install@opentelemetry/instrumentation-http and/or @opentelemetry/instrumentation-fetch. Every outbound HTTP request inside wrapAgent becomes a generic span with method, URL, status, and duration.
| Layer | Span kind | Captured |
|---|---|---|
Node http / https | generic | method, host, path, status, duration |
Node global fetch (18+) | generic | Same |
Python requests / httpx | generic | Same (via opentelemetry-instrumentation-requests / -httpx) |
When you actually want HTTP spans
- Custom LLM provider with no upstream instrumentation (local Ollama, vLLM, a homegrown inference server).
- Tools that hit external APIs you want visible (weather, billing, CRM).
- Cross-service propagation — the outbound request that carries
X-Trodo-Run-Idshows up as a span on the caller side automatically.
Example — manual LLM span over raw fetch
Auto HTTP spans record URL + status but no tokens. To get tokens/cost, calltrodo.trackLlmCall after the request:
generic HTTP span from the auto-instrumentation, and the llm span from trackLlmCall. Disable HTTP auto-instrumentation if you’d rather keep the waterfall clean.
Example — tool that hits an external API
tool span (wrapping) and the generic HTTP span (the underlying call). Without auto-instrumentation, you’ll just see the tool span, which is usually what you want.
Cross-service propagation
propagationHeaders() returns X-Trodo-Run-Id + X-Trodo-Parent-Span-Id for the current context. Attach them to outbound requests so the downstream service can joinRun under your run instead of opening its own:
Auto vs manual cheat-table
| Scenario | Auto span? | Gets tokens? | Recommended |
|---|---|---|---|
| OpenAI / Anthropic / etc. (auto-instrumented) | yes | yes | Just install the framework’s OTel package |
| Ollama / vLLM / custom inference | yes (URL only) | no | trackLlmCall after the request |
| External tool API (weather, CRM) | yes | n/a | Wrap the caller in trodo.tool for a named span; disable HTTP noise |
| Cross-service RPC | yes | n/a | propagationHeaders() on caller, middleware on callee |
Gotchas
- HTTP instrumentation captures
authorizationheaders by default — configure the underlying OTel package to redact them if you ship spans off-box. fetchinstrumentation in Node 18+ requires a recent@opentelemetry/instrumentation-fetchthat supports the undici-backed global fetch; older versions only patch browser fetch.- Disabling HTTP instrumentation does not disable cross-service propagation —
propagationHeaders()works independently because it reads context directly.