Skip to content

feat(extra): better OTEL instrumentation#407

Merged
simonvdk-mistral merged 8 commits intomainfrom
svdk/feat/better_otel_instrumentation
Mar 10, 2026
Merged

feat(extra): better OTEL instrumentation#407
simonvdk-mistral merged 8 commits intomainfrom
svdk/feat/better_otel_instrumentation

Conversation

@simonvdk-mistral
Copy link
Copy Markdown
Contributor

@simonvdk-mistral simonvdk-mistral commented Mar 9, 2026

Objective

  • Follow more closely GenAI convention
  • Remove custom MistralAI attributes, where relevant

Summary of main changes

  • Don't add any GenAI attributes when it's not a GenAI operation (for instance on get agent), as per convention
  • Removal of MistralAI attributes that are redundant with the GenAI or error OTEL convention
  • Change span names to be as close as possible with the convention
  • Add inputs, outputs, tool call arguments and results to the span attributes, following the JSONSchemas from the convention

Changes mainly impact GenAI and custom MistralAI span attributes, which are to be assumed unstable as the associated OTEL convention is not stable.

How to test

The OTEL tests are meant to serve as a basis on the main use cases we may encounter. To run them locally:

uv run python -m unittest discover -s src/mistralai_private/extra/tests -t src

Note: dependencies changes echo #406

@simonvdk-mistral simonvdk-mistral force-pushed the svdk/feat/better_otel_instrumentation branch from a2ad7fb to 4c69dac Compare March 9, 2026 17:07
@simonvdk-mistral simonvdk-mistral marked this pull request as ready for review March 9, 2026 17:39
@louis-sanna-dev
Copy link
Copy Markdown
Contributor

Heads up: this still uses request._content and response._content in a few places — httpx 0.28.1 removed _content from Request objects (see #402 / #347). Should switch to the public .content property to avoid breakage.

@simonvdk-mistral
Copy link
Copy Markdown
Contributor Author

Heads up: this still uses request._content and response._content in a few places — httpx 0.28.1 removed _content from Request objects (see #402 / #347). Should switch to the public .content property to avoid breakage.

Good catch; fixed

@simonvdk-mistral simonvdk-mistral merged commit f5e9908 into main Mar 10, 2026
8 of 10 checks passed
@simonvdk-mistral simonvdk-mistral deleted the svdk/feat/better_otel_instrumentation branch March 10, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants