Record proxied exit codes and subcommands in command telemetry - #396
Open
gtsiolis wants to merge 2 commits into
Open
Record proxied exit codes and subcommands in command telemetry#396gtsiolis wants to merge 2 commits into
gtsiolis wants to merge 2 commits into
Conversation
gtsiolis
force-pushed
the
devx-1003-record-proxied-exit-code-and-subcommand
branch
3 times, most recently
from
July 22, 2026 07:07
80c4a90 to
69fec42
Compare
gtsiolis
force-pushed
the
devx-1003-record-proxied-exit-code-and-subcommand
branch
2 times, most recently
from
July 28, 2026 07:11
ab94007 to
cca169b
Compare
gtsiolis
marked this pull request as ready for review
August 4, 2026 11:49
gtsiolis
force-pushed
the
devx-1003-record-proxied-exit-code-and-subcommand
branch
from
August 4, 2026 11:52
cca169b to
8f1ca0f
Compare
Co-Authored-By: Claude <noreply@anthropic.com>
gtsiolis
force-pushed
the
devx-1003-record-proxied-exit-code-and-subcommand
branch
from
August 5, 2026 07:10
8f1ca0f to
27fec23
Compare
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.
Summary
Improve command telemetry for proxied tools so failures can be attributed to the command that ran and to its real process exit code.
This addresses the diagnostic gap behind DEVX-1003: analytics showed
exit status 252frequently, butlstk_commandflattened failures toexit_code=1and proxy commands did not expose enough command-path context to identify the affected AWS service or operation.Classifying proxied-tool failures separately from lstk failures remains out of scope and is tracked by DEVX-1004.
Root cause
Cobra cannot derive a command path below proxy commands because they disable flag parsing and forward their arguments verbatim. Telemetry therefore saw only commands such as
awsorterraform.Exit codes were also recorded before all command wrappers had finished translating errors. In JSON mode, this meant telemetry and tracing could miss the final process exit code attached by the JSON envelope.
Approach
cmd.ExitCode, preserving wrapped-process and JSON exit codes across process handling, command telemetry, tracing, and extension telemetry.parameters.subcommandusing each proxy CLI's grammar: AWS records service + operation; known nested Terraform/SAM groups record group + action; flat or positional commands record only the top-level command.--endpoint-url, stop at flag-like arguments, cap tokens at 64 runes, and omit unsafe values so resource names, stack names, addresses, and search terms do not enter telemetry.Verification
make test— 1,444 tests passedmake test-integration RUN=TestAWSProxyTelemetryRecordsExitCodeAndSubcommand— passedgofmtcheck on the changed Go files — cleanReview: Human review advised because this changes the telemetry schema, middleware ordering, and the privacy boundary for proxy command tokens.
Towards DEVX-1003
Co-Authored-By: Claude noreply@anthropic.com