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
| Integration | Enablement | LLM calls | Tool calls | Agent spans |
|---|---|---|---|---|
| Mistral SDK (Python) | Opt-in (configure_telemetry) | Yes | Manual, via get_telemetry_tracer | Yes |
| Mistral SDK (TypeScript) | Opt-in (configureTelemetry) | Yes | Manual, via getTelemetryTracer | Yes |
| Workflows | Automatic (OTEL_ENABLED=true on the service) | Yes | Yes | N/A |
| Vibe Code CLI | Opt-in (enable_otel = true) | Yes | Yes | Yes |
| Vibe Work | Admin toggle in Studio | Yes | Yes | Yes |
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
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 hereVerify 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:
- Your API key belongs to an Enterprise workspace with Observability enabled.
- You called
configure_telemetry(client)(or the TypeScript equivalent) before making any API calls. - Your workspace role is Org Admin, Workspace Admin, or Observability Viewer.