feat(libsy): record task_kind and agent_role on the run span - #249
Open
yanyanz89 wants to merge 1 commit into
Open
feat(libsy): record task_kind and agent_role on the run span#249yanyanz89 wants to merge 1 commit into
yanyanz89 wants to merge 1 commit into
Conversation
Metadata::from_headers already parses both fields, but run_span drops them. They are the only fields describing the semantic class of work a request represents, so routing telemetry cannot be segmented by it. Span fields only; no metric labels are added and no cardinality invariant is affected. Signed-off-by: yanyanz89 <yanyzhang@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThe change adds ChangesObservability metadata
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
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.
What
run_spanrecordssession_id,agent_id,task_id, andcorrelation_idfrom the requestMetadata, but nottask_kindoragent_role. This adds them.Why
Metadata::from_headersalready parses both on every request, and they are the only fields describing what kind of work a request is; everything else is an opaque id. Today they are parsed and then dropped before reaching telemetry, so routing behaviour cannot be segmented by work type. #145 noted the same gap on live traffic and left it as a follow-up.Both have real producers: Codex emits them inside
x-codex-turn-metadata, andHEADER_CONFIGalready normalizes them.Span fields only. No metric gains a label, so the bounded-label invariant in
docs/internal/metrics_reference.mdis unaffected.Related: #145
How tested
Rust-only change, so the Python gates do not apply.
cargo fmt --all -- --checkcleancargo clippy -p switchyard-libsy --all-targets -- -D warningscleancargo test -p switchyard-libsy --test observabilitygreen (6 passed)Extends the existing span assertions in
successful_run_records_metrics_spans_and_decision_log. Stashing only thesrcchange while keeping the test fails withleft: None, right: Some("code_review"), so the coverage is load-bearing rather than incidentally green.Checklist
snake_caseof the primary class. — N/Aswitchyard/__init__.py.__all__if intended for downstream use. — N/A--helpupdated if customer-facing surface changed. — N/ASigned-off-by: Your Name <email>) per the DCO.Notes for reviewers
agent_kindleft out to keep this to one concern.Summary by CodeRabbit