TracingGuidesInstrumentationFrameworks

Overview

Which provider SDKs and frameworks Trodo captures on its own, which package to install for each, and what to do when yours isn't listed.

init registers an instrumentor for every supported provider and framework it finds installed. So for each one you use, install its instrumentor package next to the Trodo SDK, and its calls inside a wrapped run become llm spans with the model, messages, response, tokens and cost.

Provider or frameworkNode packagePython package
OpenAI@opentelemetry/instrumentation-openaiopentelemetry-instrumentation-openai
Anthropic@traceloop/instrumentation-anthropicopentelemetry-instrumentation-anthropic
LangChain@traceloop/instrumentation-langchainopentelemetry-instrumentation-langchain
LlamaIndex@traceloop/instrumentation-llamaindexopentelemetry-instrumentation-llamaindex
Google Gemini@traceloop/instrumentation-google-generativeaiopentelemetry-instrumentation-google-generativeai
Google Vertex AI@traceloop/instrumentation-vertexaiopentelemetry-instrumentation-vertexai
AWS Bedrock@traceloop/instrumentation-bedrockopentelemetry-instrumentation-bedrock
Cohere@traceloop/instrumentation-cohereopentelemetry-instrumentation-cohere
Mistralnone: use trodo.llmopentelemetry-instrumentation-mistralai
Haystackn/aopentelemetry-instrumentation-haystack
Vercel AI SDKbuilt in, nothing to installn/a
HTTP calls@opentelemetry/instrumentation-httpopentelemetry-instrumentation-requests

Run once with debug: true in init to see which instrumentors loaded and which were skipped, and why.

Use one instrumentor per call

A framework built on a provider SDK, such as LangChain over OpenAI, can be captured by both instrumentors, which records each model call twice. Trodo turns off the LangChain and LlamaIndex instrumentors for you when a provider instrumentor is already active, and says so at startup. To choose the other way round, turn the provider's off:

trodo.init({ siteId, disableInstrumentations: ['openai'] });

Don't wrap an auto-captured call in trodo.llm either; that records it twice too.

Node with ES modules

Under ES modules ("type": "module"), the raw OpenAI, Anthropic and Google SDKs are not captured, even with the node --import trodo-node/register preload. For those calls either:

  • wrap them with trodo.llm(...), which works under any module system, or
  • run that service as CommonJS, with init in the first module it loads.

LangChain and the Vercel AI SDK are captured under ES modules. Python is not affected.

Not listed?

Wrap the call with trodo.llm, or record a response you already have with trackLlmCall. If your framework emits OpenTelemetry spans itself, those are recorded too (OpenTelemetry).

On this page