[Feat] Support external OTLP collector for trace runtime - #2041
Open
matrix72c wants to merge 5 commits into
Open
[Feat] Support external OTLP collector for trace runtime#2041matrix72c wants to merge 5 commits into
matrix72c wants to merge 5 commits into
Conversation
matrix72c
force-pushed
the
feat/external-otel-collector
branch
from
August 24, 2026 14:09
d6f6738 to
7681fde
Compare
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.
Summary
TraceConfig.external_otlp_endpointso all XTuner processes can export spans to an externally managed, network-reachable OTLP collectortraces.jsonlas the default when no external endpoint is configuredexternal_trace_jsonl_pathMotivation
The XTuner viewer already reads
traces.jsonldirectly. It is a consumer of the trace file, however, not the component that receives spans or writes that file.The default trace path introduced in #1946 is:
This works when every traced process can reach the driver's loopback collector. In a multi-pod deployment, each pod resolves
127.0.0.1to itself, so a remote Ray actor cannot export spans to the collector running in the driver pod. The resulting JSONL and Jaeger trace therefore miss spans from remote actors.This PR allows the producers to use a routable collector Service instead:
Configuration and ownership
external_otlp_endpointis propagated to Ray child processes so every process exports to the same reachable collector.external_trace_jsonl_pathdoes not configure the collector and is not propagated to Ray child processes. It only tells the driver-side viewer where to read the collector-owned JSONL file.service.nameand XTunerrun.id, so the file may contain spans from multiple runs.xtuner_viewer_enabled=False; no JSONL path is required.Compatibility
When
external_otlp_endpointis unset, local collector startup, per-runtraces.jsonloutput, viewer startup, and shutdown behavior remain unchanged. External collectors are never started or stopped by XTuner.Verification
ruff checkcompileallgit diff --check