feat: add project aware trace support for runtime - #2273
Conversation
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice, focused addition that mirrors the existing project log runtime handler almost exactly.
- Reuses
createListTracesHandler/createGetTraceHandlerand the sharedruntimeLogGroup/DEFAULT_ENDPOINT_QUALIFIERhelpers so behavior stays consistent withruntime traces. resolveProjectRuntimecorrectly pins the region fromdeployed.target.region(rather than trusting the backend echo) — matches the note inProjectManager.resolveDeployedResource.- Command path (
/agentcore/project/traces/runtime/{list,get}) satisfies the telemetrycommandPathSchema, socli.command_runevents emitted by the router will still validate — no extra telemetry wiring needed. - Tests use
tmpdir+ a realProjectSpecSchema-parsed project and only stub at the true boundaries (ProjectBackend,core.observability), which matches the workspace guidance on mocking. - README tree and examples are updated to match the new subcommand.
Minor consistency observation (non-blocking): the imperative runtime traces router is built via createTracesHandler({ description, list, get }), while createProjectRuntimeTracesHandler constructs new Router("runtime", ...).handler(list).handler(get) inline. Functionally equivalent, but you could route through createTracesHandler for symmetry with runtime/traces/index.tsx.
Nothing here needs to change before merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## project-logs #2273 +/- ##
=============================================
Coverage 96.93% 96.93%
=============================================
Files 567 569 +2
Lines 39231 39287 +56
=============================================
+ Hits 38027 38083 +56
Misses 1204 1204 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Adds project-aware runtime traces through
agentcore project traces runtime list|get. The commands resolve a runtime and target to its physical id and region, thendelegates to the existing shared observability trace handlers.This PR builds on the project observability setup introduced in PR #2271. Also adds tests exercising routing and updates the readMe with project trace examples.
Type of Change
Testing
How have you tested the change?
Manual testing, plus added tests exercising runtime resolution, explicit target/qualifier selection, and region propagation.
bun run test(3170 pass, 0 fail)npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.
Stack created with GitHub Stacks CLI • Give Feedback 💬