Skip to main content
OpenInference is a set of OpenTelemetry instrumentors for LLM frameworks and providers. Each one auto-captures model calls, tool calls, retrieval steps, and agent runs as OTLP spans. AgentMark reads the OpenInference attribute conventions directly, so any OpenInference-instrumented app sends usable traces by pointing its exporter at AgentMark — no per-framework setup on the AgentMark side.

Supported frameworks

OpenInference maintains instrumentors for a wide range of libraries, including:
CategoryInstrumentors
OrchestrationLangChain, LangGraph, LlamaIndex, Haystack, DSPy
AgentsOpenAI Agents SDK, CrewAI, AutoGen, smolagents, Google ADK, Agno
ProvidersOpenAI, Anthropic, Amazon Bedrock, Vertex AI, Gemini, Mistral, Groq, LiteLLM
OtherInstructor, Guardrails, Model Context Protocol (MCP)
See the OpenInference repository for the complete, current list and the Python and JavaScript package names.

Setup

OpenInference ships instrumentors for both Python and JavaScript/TypeScript. The example below instruments OpenAI; swap the instrumentor package and class for the framework you use — the OTLP wiring stays identical.
1

Install the instrumentor and the OTLP exporter

npm install @arizeai/openinference-instrumentation-openai \
  @opentelemetry/sdk-trace-node @opentelemetry/sdk-trace-base \
  @opentelemetry/exporter-trace-otlp-http @opentelemetry/instrumentation
2

Point the exporter at AgentMark

Register a tracer provider that exports to AgentMark, then instrument your framework. Use your AgentMark API key and app id (from project settings).
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { registerInstrumentations } from "@opentelemetry/instrumentation";
import { OpenAIInstrumentation } from "@arizeai/openinference-instrumentation-openai";

const provider = new NodeTracerProvider({
  spanProcessors: [
    new BatchSpanProcessor(
      new OTLPTraceExporter({
        url: "https://api.agentmark.co/v1/traces",
        headers: {
          Authorization: process.env.AGENTMARK_API_KEY!, // raw key, no "Bearer" prefix
          "X-Agentmark-App-Id": process.env.AGENTMARK_APP_ID!,
        },
      })
    ),
  ],
});
provider.register();

registerInstrumentations({ instrumentations: [new OpenAIInstrumentation()] });
Swap OpenAIInstrumentation / OpenAIInstrumentor for the instrumentor that matches your framework (for example @arizeai/openinference-instrumentation-langchain or openinference-instrumentation-langchain).
In TypeScript, this setup must run before the instrumented libraries are imported, so the instrumentor can patch them. Put it in its own module and load it first, for example node -r ./instrumentation.js app.js.
3

Run your app

Run your application as usual. Each model call, tool call, and retrieval step arrives in AgentMark as a span, grouped into a trace. See Traces and logs.
Every OpenInference instrumentor exports through the same OTLP endpoint, so the only thing that changes between frameworks is the instrumentor you install and register. You can also set the endpoint and headers with the standard OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_TRACES_HEADERS environment variables instead of configuring the exporter in code — see OpenTelemetry.

What AgentMark captures

AgentMark maps OpenInference attributes onto its normalized trace fields:
OpenInference attributeAgentMark field
llm.model_nameModel
llm.token_count.prompt / .completion / .totalInput / output / total tokens
llm.token_count.completion_details.reasoningReasoning tokens
llm.input_messages.* / llm.output_messages.*Input / output messages
input.value / output.valueInput / output on chain, tool, and agent spans
llm.output_messages.*.tool_calls.*Tool calls
llm.invocation_parametersSettings (temperature, max tokens, top-p, penalties)
retrieval.documents.*.document.contentOutput on retrieval spans
openinference.span.kindSpan kind (llm, tool, agent, retrieval, …)
session.id / user.id / metadataSession, user, and custom metadata
Token counts and the model feed AgentMark’s cost tracking automatically.

Next steps

OpenTelemetry endpoint

The endpoint, authentication, and environment-variable configuration

Traces and logs

Explore traces once they arrive

Have questions?

Reach out any time: