Send traces

This page covers how to instrument each supported data source so it sends OpenTelemetry traces to Mistral. After traces are flowing, you can explore them in the Trace Explorer.

Sending traces requires only a valid Mistral API key: no feature flag or special role is needed.

Coverage by integration

Coverage by integration

IntegrationEnablementLLM callsTool callsAgent spans
Mistral SDK (Python)Opt-in (configure_telemetry)YesManual, via get_telemetry_tracerYes
Mistral SDK (TypeScript)Opt-in (configureTelemetry)YesManual, via getTelemetryTracerYes
WorkflowsAutomatic (OTEL_ENABLED=true on the service)YesYesN/A
Vibe Code CLIOpt-in (enable_otel = true)YesYesYes
Vibe WorkAdmin toggle in StudioYesYesYes
Note

Every source above redacts spans client-side before export by default. See Data redaction to review the policy or change what is masked.

The following Mistral products don't send traces:

  • Vibe Code Web (browser-based)
  • Studio Playground
Enable tracing

Enable tracing

Requirements: Mistral Python SDK with the telemetry extra. The code examples require mistralai[telemetry] >= 2.4.13.

Observability is in Private Preview and the SDK integration changes quickly, so we recommend using the latest SDK version.

uv add "mistralai[telemetry]"

For more details, see the SDK's observability README and examples.

from mistralai.client import Mistral
from mistralai.extra.observability import configure_telemetry

client = Mistral(api_key="your-api-key")
configure_telemetry(client)

After this call, the SDK traces all LLM calls, embeddings, agent operations, FIM completions, and OCR requests automatically.

Add tool spans manually:

Tool calls within your application aren't traced automatically. Use get_telemetry_tracer to add them:

from mistralai.client import Mistral
from mistralai.extra.observability import configure_telemetry, get_telemetry_tracer

client = Mistral(api_key="your-api-key")
configure_telemetry(client)
tracer = get_telemetry_tracer(client, "my-agent")

with tracer.start_as_current_span("invoke_agent"):
    response = client.chat.complete(
        model="mistral-small-latest",
        messages=[{"role": "user", "content": "Search for recent news."}],
    )

    with tracer.start_as_current_span("execute_tool web_search") as tool_span:
        tool_span.set_attribute("gen_ai.tool.name", "web_search")
        tool_span.set_attribute("gen_ai.tool.call.arguments", "recent news")
        # run your tool here
Verify traces are arriving

Verify traces are arriving

After enabling instrumentation, make one or more requests through your application, then open the Trace Explorer in Studio. Traces typically appear within a few seconds.

If you don't see any traces, check that:

  1. Your API key belongs to an Enterprise workspace with Observability enabled.
  2. You called configure_telemetry(client) (or the TypeScript equivalent) before making any API calls.
  3. Your workspace role is Org Admin, Workspace Admin, or Observability Viewer.
FAQ

FAQ