mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #241] [MERGED] fix: record bare tracing instrument fields on fetch_byte_range and fork_sandbox #282
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#282
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/241
Author: @YXalix
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @LSX-s-Software
Base:
main← Head:fix/instrument-empty-span-fields📝 Commits (1)
8134ddefix: record bare tracing instrument fields on fetch_byte_range and fork_sandbox📊 Changes
2 files changed (+3 additions, -3 deletions)
View changed files
📝
src/orchestrator/service.rs(+2 -2)📝
src/p2p/iroh/transport.rs(+1 -1)📄 Description
What
Give explicit values to bare field names in two
#[tracing::instrument(fields(...))]attributes:IrohBlobsP2pTransport::fetch_byte_range(src/p2p/iroh/transport.rs):offset, len->offset = offset, len = lenOrchestrator::fork_sandbox_inner(src/orchestrator/service.rs):count->count = child_specs.len(), andchild_specsadded toskip(...)so the fullVec<SandboxForkChildSpec>(volume mounts, extra drives) is no longer Debug-dumped into every span event.Why
In
tracing-attributes, a bare field name inside#[instrument(fields(...))]does not record the local variable of the same name — it expands to::tracing::field::Empty, a placeholder meant to be filled later viaSpan::record()(see theXXX(eliza)comment in tracing-attributes'attr.rs). Since nothing ever records these fields, the fmt layer prints nothing for them: P2P range reads never loggedoffset/lenand fork never loggedcount, even though the attributes suggest they should.Related issue
N/A — minor observability fix found by log inspection.
Scope and non-goals
fields(...)entries above. These are the only bare fields project-wide that were never recorded (verified by scanning every#[instrument]attribute and*_span!macro in the workspace).storage/ublk/src/dev.rsstart()usesfields(dev_id)intentionally and fills it viaSpan::current().record("dev_id", ...)— left unchanged.main,fork_sandbox_innerderivescountinside the body fromchild_specs, so the span recordschild_specs.len()at entry rather than acountargument.Design and behavior changes
No behavior change; only span metadata.
fork_sandbox_innerrecordscount = child_specs.len()at span creation (function entry), before the body's existingu32::try_from(child_specs.len())conversion — the value printed is the same child count.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons: unit/integration tests not run — the change only touches
#[instrument]field expressions (no runtime logic); compile-level verification viamake clippycovers the attribute expansion.Risks and reviewer notes
Zero functional risk: only tracing span field expressions changed. Reviewers can confirm by checking that both edited lines are field expressions evaluated at span creation.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.