You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add agentcore traces command and trace link in invoke TUI (#493)
* feat: add `agentcore traces` command and trace link in invoke TUI
Add traces support with three features:
1. `agentcore traces list` - Lists recent traces for a deployed agent
by querying CloudWatch Logs Insights. Supports --agent, --target,
and --limit options. Displays trace ID, timestamp, and session ID.
2. `agentcore traces get <traceId>` - Downloads a full trace to a JSON
file from CloudWatch Logs. Supports --agent, --target, and --output
options. Saves OpenTelemetry span data to agentcore/.cli/traces/.
3. Trace console link in invoke TUI header - Shows the CloudWatch
console URL for viewing traces alongside the existing log link.
Both commands also print the CloudWatch console URL for quick access
to the trace dashboard.
New dependency: @aws-sdk/client-cloudwatch-logs
* chore: remove --target option from traces commands
Multiple targets are not currently supported, so remove the --target
flag from both `traces list` and `traces get` to avoid exposing an
unsupported concept. The commands now always use the single deployed
target.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: increase get-trace query timeout to 60s and add timeout detection
The polling loop only waited 30 seconds and silently fell through to a
misleading "No trace data found" error on timeout. Increase to 60s and
add an explicit timeout check matching the pattern in list-traces.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: increase list-traces query timeout to 60s
Match the get-trace timeout increase for consistency. Large log groups
may need more than 30 seconds for CWL Insights queries to complete.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: show full trace ID and session ID in traces list output
Truncating IDs made them unusable as input to `traces get`. Display the
full values so users can copy-paste trace IDs directly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: extract shared agent resolution + add --since/--until to traces list
Extract duplicate agent resolution logic into a shared resolve-agent utility
(src/cli/operations/resolve-agent.ts) used by both logs and traces commands.
Move time-parser to shared utils (src/lib/utils/time-parser.ts). Add --since
and --until flags to `traces list` for custom time range queries instead of
the hardcoded 12h window.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: extract DEFAULT endpoint name to shared constant
Move the repeated 'DEFAULT' endpoint name string to DEFAULT_ENDPOINT_NAME
in cli/constants.ts and use it across logs/action.ts, get-trace.ts,
list-traces.ts, and trace-url.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: hoist traceUrl computation out of inline IIFE in InvokeScreen
Compute traceUrl at the top of the render block instead of using an
inline IIFE in the JSX. Simplifies the template to a straightforward
conditional render.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: validate --limit is a number in traces list
Return an error early if the user passes a non-numeric value for
--limit instead of silently passing NaN to the CloudWatch query.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: validate traceId format before interpolating into CWL query
Reject non-hex trace IDs early to prevent query syntax injection
and give a clearer error for malformed input.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments