Instrumentors
Auto-instrument frameworks, clean up, and instrument other languages.
Each framework has its own instrumentor package. Install the one for your framework and call .instrument().
# Pattern is the same for every framework:
from traceai_<framework> import <Framework>Instrumentor
<Framework>Instrumentor().instrument(tracer_provider=trace_provider)
| Package | Framework | Instrumentor class |
|---|---|---|
traceai-openai | OpenAI | OpenAIInstrumentor |
traceai-anthropic | Anthropic | AnthropicInstrumentor |
traceai-google-genai | Google GenAI | GoogleGenAIInstrumentor |
traceai-vertexai | Vertex AI | VertexAIInstrumentor |
traceai-bedrock | AWS Bedrock | BedrockInstrumentor |
traceai-mistralai | Mistral AI | MistralAIInstrumentor |
traceai-groq | Groq | GroqInstrumentor |
traceai-litellm | LiteLLM | LiteLLMInstrumentor |
traceai-cohere | Cohere | CohereInstrumentor |
traceai-ollama | Ollama | OllamaInstrumentor |
traceai-deepseek | DeepSeek | DeepSeekInstrumentor |
traceai-together | Together AI | TogetherInstrumentor |
traceai-fireworks | Fireworks AI | FireworksInstrumentor |
traceai-cerebras | Cerebras | CerebrasInstrumentor |
traceai-xai | xAI / Grok | XAIInstrumentor |
traceai-vllm | vLLM | VLLMInstrumentor |
traceai-portkey | Portkey | PortkeyInstrumentor |
traceai-huggingface | HuggingFace | HuggingFaceInstrumentor |
| Package | Framework | Instrumentor class |
|---|---|---|
traceai-langchain | LangChain / LangGraph | LangChainInstrumentor |
traceai-llamaindex | LlamaIndex | LlamaIndexInstrumentor |
traceai-crewai | CrewAI | CrewAIInstrumentor |
traceai-openai-agents | OpenAI Agents SDK | OpenAIAgentsInstrumentor |
traceai-autogen | Microsoft AutoGen | AutoGenInstrumentor |
traceai-smolagents | HuggingFace SmolAgents | SmolAgentsInstrumentor |
traceai-google-adk | Google Agent Dev Kit | GoogleADKInstrumentor |
traceai-claude-agent-sdk | Claude Agent SDK | ClaudeAgentSDKInstrumentor |
traceai-pydantic-ai | Pydantic AI | PydanticAIInstrumentor |
traceai-strands | AWS Strands Agents | StrandsInstrumentor |
traceai-agno | Agno | AgnoInstrumentor |
traceai-beeai | IBM BeeAI | BeeAIInstrumentor |
traceai-haystack | Haystack | HaystackInstrumentor |
traceai-dspy | DSPy | DSPyInstrumentor |
traceai-guardrails | Guardrails AI | GuardrailsInstrumentor |
traceai-instructor | Instructor | InstructorInstrumentor |
traceai-mcp | Model Context Protocol | MCPInstrumentor |
| Package | Framework | Instrumentor class |
|---|---|---|
traceai-pipecat | Pipecat | PipecatInstrumentor |
traceai-livekit | LiveKit | LiveKitInstrumentor |
| Package | Framework | Instrumentor class |
|---|---|---|
traceai-pinecone | Pinecone | PineconeInstrumentor |
traceai-chromadb | ChromaDB | ChromaDBInstrumentor |
traceai-qdrant | Qdrant | QdrantInstrumentor |
traceai-weaviate | Weaviate | WeaviateInstrumentor |
traceai-milvus | Milvus | MilvusInstrumentor |
traceai-lancedb | LanceDB | LanceDBInstrumentor |
traceai-mongodb | MongoDB | MongoDBInstrumentor |
traceai-pgvector | pgvector | PgVectorInstrumentor |
traceai-redis | Redis | RedisInstrumentor |
Cleanup
To remove instrumentation (useful in tests or serverless cleanup):
OpenAIInstrumentor().uninstrument() TraceAI.shutdown(); // Flushes remaining spans and shuts down TraceAI.Shutdown(); // Flushes remaining spans and shuts down For per-framework setup guides with full examples, see the Auto-Instrumentation docs.
Other Languages
The tables above show Python packages. TypeScript, Java, and C# have their own instrumentation libraries:
TypeScript packages follow the @traceai/<framework> pattern. All use OpenTelemetry’s registerInstrumentations().
import { registerInstrumentations } from "@opentelemetry/instrumentation";
import { OpenAIInstrumentation } from "@traceai/openai";
import { AnthropicInstrumentation } from "@traceai/anthropic";
import { LangChainInstrumentation } from "@traceai/langchain";
import { PineconeInstrumentation } from "@traceai/pinecone";
registerInstrumentations({
tracerProvider,
instrumentations: [
new OpenAIInstrumentation(),
new AnthropicInstrumentation(),
new LangChainInstrumentation(),
new PineconeInstrumentation(),
],
});40+ packages available including all LLM providers, frameworks, and vector DBs from the Python list, plus @traceai/vercel for Vercel/Next.js and @traceai/mastra.
Java uses the Traced* wrapper pattern. Each integration wraps the native client:
// LLM Providers
TracedOpenAIClient traced = new TracedOpenAIClient(openAIClient);
TracedAnthropicClient traced = new TracedAnthropicClient(anthropicClient);
TracedBedrockRuntimeClient traced = new TracedBedrockRuntimeClient(bedrockClient);
TracedGenerativeModel traced = new TracedGenerativeModel(model); // Google GenAI
TracedOllamaAPI traced = new TracedOllamaAPI(ollamaAPI);
TracedCohereClient traced = new TracedCohereClient(cohereClient);
TracedWatsonxAI traced = new TracedWatsonxAI(watsonxClient);
// Vector Databases
TracedPineconeIndex traced = new TracedPineconeIndex(index, "my-index");
TracedQdrantClient traced = new TracedQdrantClient(qdrantClient);
TracedMilvusClient traced = new TracedMilvusClient(milvusClient);
TracedChromaCollection traced = new TracedChromaCollection(collection);
TracedMongoVectorSearch traced = new TracedMongoVectorSearch(collection);
TracedRedisVectorSearch traced = new TracedRedisVectorSearch(jedis);
TracedSearchClient traced = new TracedSearchClient(searchClient); // Azure Search
TracedPgVectorStore traced = new TracedPgVectorStore(connection);
TracedElasticsearchClient traced = new TracedElasticsearchClient(esClient);
// Framework integrations
TracedChatLanguageModel traced = new TracedChatLanguageModel(model, tracer, "openai"); // LangChain4j
TracedChatModel traced = new TracedChatModel(chatModel, tracer, "openai"); // Spring AI
TracedKernel traced = new TracedKernel(kernel, tracer); // Semantic KernelMaven coordinates: com.github.future-agi.traceAI:traceai-java-<provider>:v1.0.0
C# uses manual tracing via FITracer. No auto-instrumentation wrappers yet - use the convenience methods (Llm(), Chain(), Agent(), Tool()) to create spans around your calls.
// Wrap any LLM call
var response = tracer.Llm("openai-call", span =>
{
span.SetAttribute(SemanticConventions.GenAiRequestModel, "gpt-4o");
span.SetInput(prompt);
var result = CallOpenAI(prompt);
span.SetOutput(result);
span.SetTokenCounts(inputTokens, outputTokens, totalTokens);
return result;
});Install: dotnet add package fi-instrumentation-otel
Questions & Discussion