Skip to content

[BOT ISSUE] Add instrumentation support for Rig (rig-core) LLM framework #37

@braintrust-bot

Description

@braintrust-bot

Summary

The Braintrust Rust SDK has no instrumentation support for Rig (rig-core), the most widely adopted Rust framework for building LLM-powered applications. Rig is not instrumented by any other Braintrust SDK either (Python, JS, Go, Ruby, Java, .NET), making this a completely uninstrumented library across the Braintrust ecosystem.

What is missing

Rig provides execution-oriented API surfaces that could be instrumented to automatically capture spans:

  • Agent trait — high-level interface with .prompt() and .chat() async methods for LLM interactions
  • CompletionModel trait — common interface for completion requests across providers (OpenAI, Anthropic, Cohere, Gemini, Mistral, and 13+ others)
  • EmbeddingModel trait — consistent API for embedding operations
  • Tool macro/trait — tool calling during agent execution
  • RAG workflows — via VectorStoreIndex trait for retrieval-augmented generation

Wrapping these traits/methods would enable automatic tracing of Rig-based applications, capturing inputs, outputs, token usage, latency, and tool call data for any provider Rig supports.

Library significance

  • 472,000+ total downloads on crates.io
  • 94 dependent crates (68 direct)
  • Latest version: 0.34.0 (actively maintained, 52 releases)
  • 18+ provider integrations built-in (OpenAI, Anthropic, Cohere, Gemini, Mistral, DeepSeek, Perplexity, etc.)
  • Production users including St Jude, Coral Protocol, and others
  • Official documentation at https://docs.rig.rs/

Braintrust docs status

not_found — No mention of Rig in Braintrust documentation. Rig is not listed on the SDK integrations page or any other Braintrust docs page.

Upstream sources

Local files inspected

  • src/extractors.rs — only OpenAI and Anthropic usage extractors; no Rig-related code
  • src/stream.rs — stream aggregator for OpenAI Chat Completions format only
  • src/types.rs — core types; no Rig integration types
  • src/lib.rs — public API exports; no Rig references
  • Cargo.toml — no rig-core dependency
  • Full codebase search for "rig", "rig-core", "CompletionModel", "EmbeddingModel" — zero results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions