Skip to content

feat(traces): enrich traces list with duration, status, input/output, and age#740

Open
jesseturner21 wants to merge 2 commits intomainfrom
feat/traces-list-parity
Open

feat(traces): enrich traces list with duration, status, input/output, and age#740
jesseturner21 wants to merge 2 commits intomainfrom
feat/traces-list-parity

Conversation

@jesseturner21
Copy link
Copy Markdown
Contributor

@jesseturner21 jesseturner21 commented Mar 31, 2026

Description

Replaces the minimal 3-column traces list output (Trace ID, Timestamp, Session ID) with a rich 7-column table matching the starter toolkit's obs list output. This gives users much better visibility into their agent's trace data directly from the CLI.

New columns

Column Description
# Row number with (latest) marker on most recent trace
Trace ID 32-char hex trace identifier
Duration Color-coded (green <100ms, yellow <1s, red >5s)
Status Span count + ✓ OK / ❌ N err indicator
Input Last user message preview (truncated to 24 chars)
Output Last assistant message preview (truncated to 24 chars)
Age Relative time (e.g., "5s ago", "2m ago", "7d ago")

Architecture

  • Phase 1: Queries aws/spans log group for span-level data (duration, status codes, span counts)
  • Phase 2: Queries runtime logs (/aws/bedrock-agentcore/runtimes/{runtimeId}-DEFAULT) for input/output message previews
  • Phase 2 gracefully falls back if runtime logs don't exist (shows traces without messages)
  • Supports Strands, botocore, and generic OTEL message formats

Screenshots

Dark theme:

traces list dark

Light theme:

traces list light

Related Issue

Closes #

Documentation PR

N/A

Type of Change

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

Testing

How have you tested the change?

  • 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

Manual E2E Testing

Bundled CLI (npm run bundle), installed globally, and tested against a deployed Strands agent (deltaAqua_Agent-HkpfaiD6hH) with real CloudWatch traces:

  • agentcore traces list --since 30d — 6 traces returned with all 7 columns, input/output extracted from Strands telemetry
  • agentcore traces list --limit 2 — correctly returns only 2 traces
  • agentcore traces list --since 1h — correctly returns "No traces found" for old data
  • All 3093 unit tests pass, 0 failures

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.

… and age

Replace the minimal 3-column traces list (ID, Timestamp, Session) with a
rich 7-column table matching the starter toolkit's obs list output.

Two-phase CloudWatch query:
- Phase 1: Query aws/spans for span-level data (duration, status, counts)
- Phase 2: Query runtime logs for input/output message previews

Supports Strands, botocore, and generic OTEL message formats.

Constraint: Must query two separate log groups (aws/spans + runtime logs)
Rejected: Single-query approach | runtime logs lack span duration/status data
Rejected: Session-scoped listing | CLI lists all traces per agent, not per session
Confidence: high
Scope-risk: narrow
Directive: Message parser handles 3 formats - add new patterns to extractMessagesFromBody if new frameworks are added
Not-tested: Agents using LangChain or GoogleADK instrumentation formats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jesseturner21 jesseturner21 requested a review from a team March 31, 2026 11:54
@github-actions github-actions bot added the size/l PR size: L label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.4.0.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-740-tarball/aws-agentcore-0.4.0.tgz

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 45.69% 6578 / 14397
🔵 Statements 45.21% 6990 / 15460
🔵 Functions 44.35% 1179 / 2658
🔵 Branches 45.74% 4362 / 9536
Generated in workflow #1553 for commit 9eeaa5e by the Vitest Coverage Report Action

SVG screenshots captured via TUI harness showing the new 7-column
traces list output with color-coded duration, status icons, and
input/output message previews.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added size/l PR size: L and removed size/l PR size: L labels Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant