Repository navigation
fix(telemetry): only follow the client's explicit serverURL for dedicated-mode traces - #289
Merged
rbarbadillo merged 2 commits intoOct 30, 2026
Merged
Conversation
…ated-mode traces Named eu/us servers keep exporting to api.mistral.ai since the regional hosts don't serve /telemetry/v1/traces, and path prefixes on serverURL are now preserved.
th-ch
approved these changes
Oct 30, 2026
…ependencies The dedicated telemetry endpoint tests load @opentelemetry/sdk-trace-base and @opentelemetry/resources for real. They are optional peer dependencies, which npm install doesn't pull in, so the tests failed in CI. Users still don't need to install them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dedicated-mode telemetry already exported to the client's server URL, but it differed from the Python SDK in two ways:
eu/usservers. It used the resolved_baseURL(and the hook'sbaseURL), soserver: "eu"exported tohttps://api.eu.mistral.ai/telemetry/v1/traces. The regional hosts don't serve the telemetry route (404), so those traces were lost.new URL("/telemetry/v1/traces", base)turnedhttps://gateway.example.com/mistralintohttps://gateway.example.com/telemetry/v1/traces.Change
The exporter endpoint now resolves as:
MISTRAL_OTLP_TRACES_ENDPOINT, if set and non-blank (unchanged override)serverURL+/telemetry/v1/traces, keeping any path prefix and stripping trailing slasheshttps://api.mistral.ai/telemetry/v1/tracesMISTRAL_TELEMETRY_BASE_URLis now derived fromServerList[ServerGlobal]; the exported constants are unchanged. Only hand-owned files changed:src/extra/observability/, its tests, and the hand-written telemetry section ofREADME.md.Behaviour changes
server: "eu"orserver: "us"now exports traces toapi.mistral.aiinstead of the regional host.serverURLwith a path prefix now keeps that prefix in the telemetry endpoint.serverURL: "https://api.eu.mistral.ai"(rather thanserver: "eu") still gets a 404 for telemetry. Useserver: "eu"or the env override.Tests
New
tests/extra/observability/telemetry-endpoint.test.tsuses a realMistralclient with a mock fetcher and a mocked OTLP exporter, for both explicitconfigureTelemetryandMISTRAL_SDK_TELEMETRY=dedicatedauto-config. It covers:server: "eu"with an explicit URL (traces go toserverURL)Against the previous implementation, 6 of the 26 new cases fail (eu, us, path prefix × both modes).