Skip to content

feat: instrument telemetry for deploy command (CLI + TUI)#1206

Merged
Hweinstock merged 1 commit into
aws:mainfrom
Hweinstock:hkobew/deploy-telemetry
May 12, 2026
Merged

feat: instrument telemetry for deploy command (CLI + TUI)#1206
Hweinstock merged 1 commit into
aws:mainfrom
Hweinstock:hkobew/deploy-telemetry

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

@Hweinstock Hweinstock commented May 12, 2026

Description

Adds telemetry instrumentation to the deploy command (CLI + TUI), following the same pattern as #1202 (create telemetry). Emits cli.command_run events with command_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

  • 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

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.

@github-actions github-actions Bot added size/m PR size: M agentcore-harness-reviewing AgentCore Harness review in progress labels May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.13.1.tgz

How to install

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

Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

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

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-59 returns an OperationResult-shaped value to withCommandRunTelemetry, so success/failure telemetry is recorded before any output is printed or process.exit is called. Since withCommandRun awaits sink.flush() in its finally, the flush completes before the process.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 by diffMode/!diffMode, so exactly one telemetry event is emitted per run. The deploy effect also runs a pre-deploy diff internally but is still a single command_run, which matches what you'd want.
  • DEFAULT_DEPLOY_ATTRS + override ({ ...DEFAULT_DEPLOY_ATTRS, mode: 'diff' as const }) handles the case where context isn't ready yet without dropping the event or emitting a wrong mode.
  • Schema migration has_diffmode is complete — no stray references anywhere under src/, tests updated accordingly.
  • computeDeployAttrs tests in utils.test.ts use 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.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 12, 2026
@Hweinstock Hweinstock force-pushed the hkobew/deploy-telemetry branch from df2fa61 to 481c679 Compare May 12, 2026 21:23
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels May 12, 2026
@Hweinstock Hweinstock force-pushed the hkobew/deploy-telemetry branch from 481c679 to 235d15d Compare May 12, 2026 21:28
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels May 12, 2026
@Hweinstock Hweinstock marked this pull request as ready for review May 12, 2026 21:47
@Hweinstock Hweinstock requested a review from a team May 12, 2026 21:47
Comment thread src/cli/commands/deploy/__tests__/utils.test.ts
Comment thread src/cli/telemetry/schemas/command-run.ts
@Hweinstock Hweinstock merged commit ce00f57 into aws:main May 12, 2026
26 checks passed
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.

3 participants