[Feature] Instrument sandbox agents and SessionServer tracing - #2040
Open
matrix72c wants to merge 2 commits into
Open
[Feature] Instrument sandbox agents and SessionServer tracing#2040matrix72c wants to merge 2 commits into
matrix72c wants to merge 2 commits into
Conversation
matrix72c
force-pushed
the
feat/sandbox-otel-instrumentation
branch
2 times, most recently
from
August 24, 2026 14:09
a340b7d to
cdee4cc
Compare
matrix72c
force-pushed
the
feat/sandbox-otel-instrumentation
branch
from
August 25, 2026 02:44
cdee4cc to
482a44b
Compare
matrix72c
force-pushed
the
feat/sandbox-otel-instrumentation
branch
from
September 7, 2026 03:51
1ebdb7c to
84ea888
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
Add OpenTelemetry instrumentation to the rollout, sandbox, and SessionServer paths so a request trace remains connected across Ray actors, sandbox stages, and the proxy lifecycle.
Motivation
The existing rollout and SessionServer paths already expose the live boundaries needed for tracing, but their OTel context was not consistently propagated across Ray calls or represented in sandbox and proxy spans. This made cross-process request traces incomplete even though the underlying training behavior was correct.
Implementation
generate_groupcalls for a singleRolloutStateor a concretelist/tuplegroup, while restoring internal carrier and call-chain fields after the call.prepare_request,backend_roundtrip, andrecord_responseunder one request span. Incoming aiohttp headers are used as the parent carrier, and the backend carrier is injected inside the roundtrip span.Compatibility
error=true.Tests
SingleTurnAgentLoopand producer compatibility tests: 29 passed.ruff checkon all changed Python files.compileallon changed modules and tests.git diff --checkand final diff review againstupstream/main.