Skip to content

Commit 733eb30

Browse files
committed
Track AI debugger invocations
1 parent 30a299a commit 733eb30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/cli/command/commands.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,17 +952,22 @@ var composeUpCmd = &cobra.Command{
952952

953953
if _, isPlayground := client.(*cliClient.PlaygroundClient); !nonInteractive && isPlayground {
954954
var aiDebug bool
955+
Track("Debug Prompted", P{"failedServices", failedServices}, P{"etag", deploy.Etag}, P{"reason", context.Cause(tailCtx)})
955956
if err := survey.AskOne(&survey.Confirm{
956957
Message: "Would you like to debug the deployment with AI?",
957958
Help: "This will send logs and artifacts to our backend and attempt to diagnose the issue and provide a solution.",
958959
}, &aiDebug); err != nil {
959960
term.Debugf("failed to ask for AI debug: %v", err)
961+
Track("Debug Prompt Failed", P{"etag", deploy.Etag}, P{"reason", err})
960962
} else if aiDebug {
963+
Track("Debug Prompt Accepted", P{"etag", deploy.Etag})
961964
// Call the AI debug endpoint using the original command context (not the tailCtx which is canceled); HACK: cmd might be canceled too
962965
// TODO: use the WorkingDir of the failed service, might not be the project's root
963966
if err := cli.Debug(context.TODO(), client, deploy.Etag, project, failedServices); err != nil {
964967
term.Warnf("failed to debug deployment: %v", err)
965968
}
969+
} else {
970+
Track("Debug Prompt Skipped", P{"etag", deploy.Etag})
966971
}
967972
}
968973
return err

0 commit comments

Comments
 (0)