Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telemetry(amazonq): modifySourceFolder event #4986

Merged
merged 1 commit into from
May 16, 2024

Conversation

sannicm
Copy link
Contributor

@sannicm sannicm commented May 14, 2024

Problem

There is no current metric tracking the usage of this UI feature form /dev which allows customer to modify root source folder. This will hopefully help us calculate any impact if this feature gets broken in the future or also have an insight of the usage.

Solution

send the modifySourceFolder when customer clicks the button to do so on the chat.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sannicm sannicm requested a review from a team as a code owner May 14, 2024 13:35
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "add modifyDefaultSource folder event when customer uses /dev source folder modification feature"
Copy link
Contributor

Choose a reason for hiding this comment

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

please review https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog

this is not a customer-impacting change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I will remove this.

@justinmk3 justinmk3 changed the title feat: add modifySourceFolder telemetry event when customer modifies default source folderwhile using /dev telemetry(amazonq): modifySourceFolder event May 14, 2024
@sannicm sannicm force-pushed the sannicm/sendMetric branch 2 times, most recently from 4277e0d to 17c71ae Compare May 15, 2024 08:59
@@ -587,6 +587,12 @@ export class FeatureDevController {
private async modifyDefaultSourceFolder(message: any) {
const session = await this.sessionStorage.getSession(message.tabID)

telemetry.amazonq_modifySourceFolder.emit({
amazonqConversationId: session.conversationId,
result: 'Succeeded',
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use the result field of this metric to show that customers might be cancelling the file picker or selecting folders that are not in the current workspace, as we discussed the other day.

How about we change this modifyDefaultSourceFolder function to return boolean (returning false when we see an error with the selection, and only returning true after we're able to call session.updateWorkspaceRoot without problems), and then on the calling function we emit the amazonq_modifySourceFolder metric with a proper result field of Succeeded if the selection worked, or Failed if it didn't?

I see the caller does this

 case FollowUpTypes.ModifyDefaultSourceFolder:
     return this.modifyDefaultSourceFolder(data)

so we can just switch that to

 case FollowUpTypes.ModifyDefaultSourceFolder:
    const result = this.modifyDefaultSourceFolder(data)
    telemetry.amazonq_modifySourceFolder.emit({
            result
             // ...
     })
     break

@@ -102,7 +102,7 @@ export class FeatureDevController {
getLogger().error('processChatItemVotedMessage failed: %s', (e as Error).message)
})
})
this.chatControllerMessageListeners.followUpClicked.event(data => {
this.chatControllerMessageListeners.followUpClicked.event(async data => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't see an await in the block. Any reason this is explicitly declared async?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leftover, I need to remove this.

@@ -592,6 +592,8 @@ export class FeatureDevController {
canSelectFiles: false,
}).prompt()

let metricData: MetricData
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this MetricData type won't be used anywhere else, it's ok to use it inline here:

let metricData: { result: 'Succeeded' } | { result: 'Failed'; reason: string } | undefined;

@sannicm sannicm force-pushed the sannicm/sendMetric branch 2 times, most recently from 36c78de to ed42329 Compare May 16, 2024 14:45
Copy link
Contributor

@hayemaxi hayemaxi left a comment

Choose a reason for hiding this comment

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

Linux tests are failing:

rejected promise not handled within 1 second: Error: Conversation id must exist before starting code generation

Some async/await issue.

@sannicm
Copy link
Contributor Author

sannicm commented May 16, 2024

Linux tests are failing:

rejected promise not handled within 1 second: Error: Conversation id must exist before starting code generation

Some async/await issue.

Yep, I was taking a look at this, I just pushed a fix, hopefully it passes now

hayemaxi
hayemaxi previously approved these changes May 16, 2024
@hayemaxi hayemaxi dismissed their stale review May 16, 2024 16:55

comments

@hayemaxi
Copy link
Contributor

Linux tests are failing:

rejected promise not handled within 1 second: Error: Conversation id must exist before starting code generation

Some async/await issue.

Yep, I was taking a look at this, I just pushed a fix, hopefully it passes now

The fix is to skip tests? Will you follow up with unskipping or removing the tests? For now, can you add a comment in code as to why the test is being skipped?

@sannicm
Copy link
Contributor Author

sannicm commented May 16, 2024

Linux tests are failing:

rejected promise not handled within 1 second: Error: Conversation id must exist before starting code generation

Some async/await issue.

Yep, I was taking a look at this, I just pushed a fix, hopefully it passes now

The fix is to skip tests? Will you follow up with unskipping or removing the tests? For now, can you add a comment in code as to why the test is being skipped?

Linux tests are failing:

rejected promise not handled within 1 second: Error: Conversation id must exist before starting code generation

Some async/await issue.

Yep, I was taking a look at this, I just pushed a fix, hopefully it passes now

The fix is to skip tests? Will you follow up with unskipping or removing the tests? For now, can you add a comment in code as to why the test is being skipped?

Oh no, I forgot to remove the skipping. Those are testing leftovers, I will update

@sannicm sannicm requested a review from hayemaxi May 16, 2024 18:41
@hayemaxi hayemaxi merged commit 143b29e into aws:master May 16, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants