Skip to content

[bot] Add instrumentation for Mistral AI Go SDK (mistralai/client-go) #159

@braintrust-bot

Description

@braintrust-bot

Summary

The Braintrust Go SDK instruments OpenAI, Anthropic, Google GenAI, sashabaranov/go-openai, LangChainGo, Firebase Genkit, Google ADK, CloudWeGo Eino, and AWS Bedrock — but does not instrument the Mistral AI Go SDK (github.com/mistralai/client-go). Mistral is explicitly listed as a supported provider in Braintrust's tracing documentation, yet it has no SDK-level instrumentation wrapper in this repository.

What is missing

A trace/contrib/mistral/ integration module that wraps execution calls on the Mistral AI Go client. The key execution surfaces are:

  • Chat / ChatStream — conversational model inference (non-streaming and streaming), including multi-turn conversations and tool calling
  • Embed — vector embedding generation

The Mistral Go SDK is generated with the Stainless SDK toolchain (same as openai-go and anthropic-sdk-go), and exposes option.WithMiddleware() for HTTP middleware injection, making it directly instrumentable with the same internal.Middleware(router, logger) pattern already used by the existing OpenAI and Anthropic integrations.

Braintrust docs status

supported — Braintrust explicitly lists Mistral as a supported provider for tracing:

"OpenAI, Anthropic, Gemini, AWS Bedrock, Azure, Mistral, Together, Groq, and many more"

Source: https://www.braintrust.dev/docs/guides/tracing and https://www.braintrust.dev/docs/instrument

However, there is no Go SDK-level tracing wrapper for the Mistral AI client in this repository.

Upstream sources

Braintrust docs sources

Local repo files inspected

  • go.mod — no mistralai/client-go dependency
  • trace/contrib/ — no mistral/ directory exists
  • trace/contrib/all/all.go — no Mistral import
  • examples/internal/ — no Mistral example
  • Grep for mistral across all repo files — zero matches
  • trace/contrib/openai/traceopenai.go — reference pattern: internal.Middleware(router, logger) with option.WithMiddleware() injection; same pattern applies to client-go since both are Stainless-generated SDKs
  • trace/contrib/anthropic/traceanthropic.go — reference pattern for Stainless-generated SDK middleware instrumentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions