Get Started

Wire Trodo tracing into your agent in minutes: let a coding agent do it, or install by hand.

There are two ways to add Trodo tracing: let a coding agent wire it for you following best practices for your stack, or install it manually. Both end the same way: one init call plus a wrap around your agent, and your runs show up in the dashboard.

Before you start

Grab your site ID from Settings → Project → General in the Trodo app. It's the only credential the SDK needs (and the Bearer token for the OTLP path). Set it as TRODO_SITE_ID in your environment.

Agentic installation

Trodo ships a skill that teaches your coding agent (Claude Code, Cursor, and others) how to detect your stack, pick the right integration path, and wire tracing the way Trodo recommends. There are two ways to get it.

Point your coding agent at the skill repo and ask it to instrument your agent, all done automatically.

Install the Trodo agent-tracing skill from github.com/trodoai/skills,
then add tracing to my agents. My Trodo site ID is <your-site-id>.
Follow Trodo's best practices for my stack.

Install the skill via npm:

npx skills add trodoai/skills --all

Then prompt your agent:

Use the Trodo skill to add agent tracing to this project.
My site ID is <your-site-id>.

Either way the skill runs a detect → confirm → install flow: it won't write code until it has shown you a plan and you've approved it.

Install manually

Prefer to do it by hand? The full set of methods, for every language and stack, lives in the Instrumentation Guide. The 90% path is three steps.

Install the package:

npm install trodo-node

Then wrap your agent's entry point with wrapAgent:

import trodo from 'trodo-node';

trodo.init({ siteId: process.env.TRODO_SITE_ID }); // once, at startup

const { result } = await trodo.wrapAgent('my-agent', async (run) => {
  run.setInput({ query });
  const answer = await agent.run(query); // provider calls auto-captured
  run.setOutput(answer);
  return answer;
});

Install the package:

pip install trodo-python

Then wrap your agent's entry point with wrap_agent:

import os, trodo

trodo.init(site_id=os.environ['TRODO_SITE_ID'])  # once, at startup

with trodo.wrap_agent('my-agent') as run:
    run.set_input({'query': query})
    answer = agent.run(query)  # provider calls auto-captured
    run.set_output(answer)

Node ESM + raw provider SDKs. Auto-instrumentation of the raw provider SDKs relies on module hooking that works out-of-the-box under CommonJS (require('trodo-node')) but not under pure ESM (import trodo from 'trodo-node') — ESM import statements are hoisted above your trodo.init(), so the provider is already imported unpatched. Fix it by preloading the shipped bootstrap:

node --import trodo-node/register your-app.js

It registers the OpenTelemetry ESM loader hook and initialises Trodo before your app is linked (reads TRODO_SITE_ID from the environment; you don't call trodo.init() yourself). This makes the raw openai SDK auto-capture under ESM.

The raw Anthropic and Google SDKs still aren't auto-captured under ESM even with the bootstrap — their instrumentors don't yet hook ESM imports. For those, run your entry as CommonJS, or wrap the call with trodo.llm(...) (works under ESM, auto-extracts tokens). Framework instrumentation (LangChain, Vercel AI SDK), the OTLP paths, and every manual API (wrapAgent, withSpan, tool, trackMcp, feedback, events) work under ESM unchanged. Python is unaffected.

Pick the path that matches your setup from the guide:

See your first trace

Run your agent once, then open the Agent Runs dashboard. The row shows tokens in and out, cost, span count, tool count, and error count, plus the full trace tree of every LLM and tool call.

Next

On this page