The Rius Python SDK (glassflow-rius) is an OpenTelemetry-native tracing SDK for AI agents and LLM applications. It sends OpenTelemetry GenAI trace data via OTLP to the GlassFlow hosted observability platform, or any OTLP-compatible backend.
Key capabilities:
- Trace LLM calls, tool calls, and agent steps, with support for per-call cost, alerts, and Claude Code / Codex / Cursor session tracing.
- Span naming follows OpenTelemetry GenAI conventions and can automatically generate names such as chat gpt-4o, embeddings text-embedding-3-small, execute_tool get_weather, invoke_agent planner, etc.; explicit naming is also supported.
- Provides manual span variants (start_span / start_generation) for lifecycles that cannot be expressed with with blocks, such as streaming and callbacks; they require manual update() and end(), and exceptions are recorded via record_exception().
- Configuration resolution prioritizes explicit parameters, followed by environment variables.
- Supports session, user, and workspace context managers; all spans within scope (including spans from auto-instrumented libraries) carry the corresponding values.
- Supports multi-workspace routing, sending different spans to different workspaces via init(workspaces={alias: api_key}) and rius.workspace(alias).
- Heartbeat mechanism: init() starts a background thread that sends a liveness ping to <endpoint>/v1/heartbeat every 15 seconds, making it easy for the console to display agent running status; it can be disabled via heartbeat=False or RIUS_HEARTBEAT=false.
- Partial span export: when partial_spans=True, each sampled span exports a snapshot once at start (without content), used for on-site records of crashed agents; partial_spans_delay can delay snapshots.
- Coexist with other OpenTelemetry SDKs: detect when the global tracer provider is occupied, and optionally export spans from other SDKs to Rius via bridge_foreign_provider=True.
- Auto-instrumentation: bundles OpenInference instrumentors as optional extras, supporting openai, anthropic, langchain, llama-index, litellm, and mcp; installing an extra does not install or upgrade the underlying libraries.
- Content capture control: the capture_content parameter and the RIUS_CAPTURE_CONTENT environment variable, compatible with OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT; mask is a code-only option that can redact exported content attributes.
- Span attribute limit: init() sets the tracer provider's attribute limit to 4096, preventing OpenInference instrumentors from silently evicting the earliest attributes due to the default limit of 128; this can be overridden via OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT.
- Context compaction tracking: automatically reports Anthropic context edits and OpenAI compaction items, and also supports manually marking custom compaction via mark_compaction.
- Export reliability: asynchronous batch export, exponential backoff retries, graceful degradation, and exceptions are not propagated to application code.
Usage: Install glassflow-rius and the required extras via pip (e.g., glassflow-rius[anthropic]), call init() to initialize, create traces using the @observe decorator or start_as_current_span, and organize trace scopes with the session(), user(), and workspace() context managers.
Use cases: Observability for AI agents and LLM applications, including call chain tracing, cost monitoring, session analysis, multi-tenant workspace isolation, crash-site diagnostics, and more.
Limitations:
- Requires an OTLP-compatible backend or the GlassFlow platform.
- Autoinstrumentation depends on third-party library versions; when versions do not satisfy the requirements, the corresponding integration is disabled and a warning is logged.
- There is only one global tracer provider per process; when coexisting with other SDKs, bridging is required or partial span splitting must be accepted.
- Heartbeats require credentials (api_key or Authorization header).
- Some features (such as workspace routing and bridging) must be explicitly enabled.
- The documentation does not provide specific billing or pricing information.