feat: instrument telemetry for deploy command (CLI + TUI)#1206
Merged
Conversation
Contributor
Package TarballHow to installnpm install https://github.com/aws/agentcore-cli/releases/download/pr-1206-tarball/aws-agentcore-0.13.1.tgz |
agentcore-cli-automation
approved these changes
May 12, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Reviewed end-to-end. The telemetry instrumentation follows the pattern established by #1202 and the docs in src/cli/telemetry/README.md, and the refactor of command.tsx cleanly separates telemetry-wrapped execution from output/exit logic.
Things I checked and that look good:
- The CLI wrapper at
command.tsx:51-59returns anOperationResult-shaped value towithCommandRunTelemetry, so success/failure telemetry is recorded before any output is printed orprocess.exitis called. SincewithCommandRunawaitssink.flush()in itsfinally, the flush completes before theprocess.exit(0/1/2)calls in the handler. - The two TUI effects in
useDeployFlow.ts(deploy effect at L548, diff effect at L736) are correctly guarded bydiffMode/!diffMode, so exactly one telemetry event is emitted per run. The deploy effect also runs a pre-deploy diff internally but is still a singlecommand_run, which matches what you'd want. DEFAULT_DEPLOY_ATTRS+ override ({ ...DEFAULT_DEPLOY_ATTRS, mode: 'diff' as const }) handles the case wherecontextisn't ready yet without dropping the event or emitting a wrong mode.- Schema migration
has_diff→modeis complete — no stray references anywhere undersrc/, tests updated accordingly. computeDeployAttrstests inutils.test.tsuse plain objects rather than mocks — exactly the style called out in the review guidelines.- Counts emitted (
runtime_count,gateway_target_count, etc.) are aggregate only; no names/paths leak into telemetry.
All CI checks are green. LGTM.
df2fa61 to
481c679
Compare
481c679 to
235d15d
Compare
notgitika
approved these changes
May 12, 2026
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.
Description
Adds telemetry instrumentation to the deploy command (CLI + TUI), following the same pattern as #1202 (create telemetry). Emits
cli.command_runevents withcommand_group: 'deploy'for all modes (deploy, dry-run, diff).Related Issue
Closes #
Documentation PR
N/A - no user-facing documentation changes needed.
Type of Change
Testing
How have you tested the change?
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.