Skip to content

feat: add project aware trace support for runtime - #2273

Open
nborges-aws wants to merge 4 commits into
project-logsfrom
project-traces
Open

feat: add project aware trace support for runtime#2273
nborges-aws wants to merge 4 commits into
project-logsfrom
project-traces

Conversation

@nborges-aws

@nborges-aws nborges-aws commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

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.

agentcore project traces runtime list
agentcore project traces runtime list --name FooRuntime --target production --since 30m
agentcore project traces runtime get <traceId> --name FooRuntime --output trace.json

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

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)
  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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 CLIGive Feedback 💬

@nborges-aws
nborges-aws added this pull request to stack #2274 September 10, 2026 19:06
@github-actions github-actions Bot added the size/m PR size: M label Sep 10, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 10, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Nice, focused addition that mirrors the existing project log runtime handler almost exactly.

  • Reuses createListTracesHandler / createGetTraceHandler and the shared runtimeLogGroup / DEFAULT_ENDPOINT_QUALIFIER helpers so behavior stays consistent with runtime traces.
  • resolveProjectRuntime correctly pins the region from deployed.target.region (rather than trusting the backend echo) — matches the note in ProjectManager.resolveDeployedResource.
  • Command path (/agentcore/project/traces/runtime/{list,get}) satisfies the telemetry commandPathSchema, so cli.command_run events emitted by the router will still validate — no extra telemetry wiring needed.
  • Tests use tmpdir + a real ProjectSpecSchema-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.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (b8b8877) to head (fb04f87).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants