Skip to Content
RiusSDKIntegrations

Integrations

Rius integrates with the client libraries, agent frameworks, and protocols agents are built on: model calls arrive as generations with tokens and cost, and run structure arrives from the framework’s own spans or a thin layer of observe wrappers. Each integration’s page covers setup, what lands in the trace, and the blind spots.

Support matrix

IntegrationTypeModel calls captured byPythonTypeScript
OpenAIClient librarythe openai instrumentation✓✓
AnthropicClient librarythe anthropic instrumentation✓✓
LangChainFrameworkits callbacks, hooked by the langchain instrumentation✓✓
LlamaIndexFrameworkthe llama-index instrumentation✓N/A
LiteLLMRouterthe litellm instrumentation✓N/A
MCPProtocolinstrumentation bundled in the SDK✓✓
Vercel AI SDKFrameworkits OpenTelemetry telemetryN/A✓
OpenAI Agents SDKAgent frameworkthe openai instrumentation underneath✓N/A
Pydantic AIAgent frameworkits native OpenTelemetry spans✓N/A
CrewAIAgent frameworkthe openai instrumentation (litellm when LiteLLM is installed)✓N/A
AutoGenAgent frameworkits native OpenTelemetry spans plus the openai instrumentation✓N/A
Claude Agent SDKAgent frameworkmanual tracing: an observe root plus a generation filled from the run result✓N/A

“N/A” means no integration in that language today; trace those calls with manual generations. Install commands and package names live on each integration’s page.

Installing

Each integration is an optional extra, and extras can be combined:

pip install "glassflow-rius[openai]" pip install "glassflow-rius[anthropic,langchain]" pip install "glassflow-rius[instruments]" # all of them

Each extra installs the instrumentation for a library, never the library itself. glassflow-rius[anthropic] expects anthropic to be in your environment already, which it is in any project that calls Anthropic: Rius deliberately takes no dependency on provider SDKs, so it never pins or upgrades the versions your code runs against. An extra installed without its library makes init() log a DependencyConflict from OpenTelemetry and leaves that integration off, which is the one failure worth recognizing here; see Troubleshooting.

mcp needs no extra at all. Its instrumentation ships inside the SDK rather than as a separate package, so there is nothing for an extra to add: it turns itself on whenever the mcp package is importable, which it is in any agent that calls MCP tools.

The client-library integrations are powered by OpenInference , the open source (Apache-2.0) instrumentation project from Arize AI; the SDK bundles its packages and wires them into the Rius pipeline. The MCP integration is built into the SDK itself.

Enabling

With a default (global) init(), every installed integration is enabled automatically:

rius.init() # everything installed rius.init(instruments=["openai"]) # only OpenAI rius.init(instruments=[]) # none

Details worth knowing:

  • Requesting an integration whose package is not installed logs a warning and continues; a broken integration never blocks init().
  • If a library is already instrumented by other OpenTelemetry code (not by this SDK), it is left alone.
  • Scoped clients (set_global=False) do not auto-instrument, because integrations patch libraries process-wide; pass instruments=[...] explicitly to opt in.

In TypeScript the loud and quiet cases are deliberately split: a package you did not install stays silent, while a package that is installed but fails to load logs a warning naming the integration and the underlying error. One exception to the silence, since 1.1.0: when your package.json lists @arizeai/openinference-instrumentation-openai or @arizeai/openinference-instrumentation-anthropic but the SDK cannot load it, init() logs one warning that names the integration and points at instrumentModules. Either way init() continues, and the remaining integrations still attach.

pnpm and serverless deployments

The TypeScript SDK finds its optional peers by importing them at runtime, relative to its own files. A file-tracing deployment of a pnpm app, such as a serverless function on Vercel, may not ship the links that import follows. The openai or anthropic integration then stays off: client.ready leaves it out and no LLM spans are recorded, while everything else looks fine.

Your own import statements are what the deployment’s file tracing does follow, so since @glassflow-ai/rius 1.1.0 you can hand the modules to init() and it patches those instead of looking for them:

import * as anthropicSdk from '@anthropic-ai/sdk' import * as anthropicInstrumentation from '@arizeai/openinference-instrumentation-anthropic' import * as openaiSdk from 'openai' import * as openaiInstrumentation from '@arizeai/openinference-instrumentation-openai' import { init } from '@glassflow-ai/rius' init({ instrumentModules: { anthropic: { instrumentation: anthropicInstrumentation, sdk: anthropicSdk }, openai: { instrumentation: openaiInstrumentation, sdk: openaiSdk }, }, })

Pass only the integrations you use. The sdk module must be the copy your own client calls go through, since patching a different copy records nothing. If a module has the wrong shape, init() logs one warning naming the integration and leaves it out of client.ready. Only openai and anthropic accept modules: langchain, vercel-ai, and mcp attach differently.

Usage counted once

When a wrapper such as LangChain, LiteLLM, LlamaIndex, or the Vercel AI SDK sits over an instrumented model call, both spans report the call’s tokens. The SDK counts each call once in token and cost totals, and the wrapper span still shows the run’s total. This needs glassflow-rius 1.1.0 (1.0.2 for LiteLLM, 1.1.1 for LlamaIndex) or @glassflow-ai/rius 1.2.0 (1.1.0 for the Vercel AI SDK on ai 7).

Auto-instrumentation covers what the SDK does to integration spans and the known gaps, with a workaround for each.

Known limitations

  • A few setups still count a call twice. See Still counted twice for the cases and which layer to keep.
  • Some streams carry no time to first token, including auto-instrumented Anthropic streams. See No time to first token.
  • OpenAI streams carry token usage only with include_usage. Without stream_options: { include_usage: true }, a streamed call has no token counts and so no cost. See OpenAI.
Last updated on