-
Notifications
You must be signed in to change notification settings - Fork 751
telemetry(webview): Emit toolkit_X module telemetry on auth webview #6791
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ import globals from '../../../shared/extensionGlobals' | |
| import { openUrl } from '../../../shared/utilities/vsCodeUtils' | ||
| import { DefaultAmazonQAppInitContext } from '../../apps/initContext' | ||
|
|
||
| const qChatModuleName = 'amazonqChat' | ||
|
|
||
| export function dispatchWebViewMessagesToApps( | ||
| webview: Webview, | ||
| webViewToAppsMessagePublishers: Map<TabType, MessagePublisher<any>> | ||
|
|
@@ -29,8 +31,8 @@ export function dispatchWebViewMessagesToApps( | |
| * This would be equivalent of the duration between "user clicked open q" and "ui has become available" | ||
| * NOTE: Amazon Q UI is only loaded ONCE. The state is saved between each hide/show of the webview. | ||
| */ | ||
| telemetry.webview_load.emit({ | ||
| webviewName: 'amazonq', | ||
| telemetry.toolkit_didLoadModule.emit({ | ||
| module: qChatModuleName, | ||
| duration: performance.measure(amazonqMark.uiReady, amazonqMark.open).duration, | ||
| result: 'Succeeded', | ||
| }) | ||
|
|
@@ -86,12 +88,19 @@ export function dispatchWebViewMessagesToApps( | |
| } | ||
|
|
||
| if (msg.type === 'error') { | ||
| const event = msg.event === 'webview_load' ? telemetry.webview_load : telemetry.webview_error | ||
| event.emit({ | ||
| webviewName: 'amazonqChat', | ||
| result: 'Failed', | ||
| reasonDesc: msg.errorMessage, | ||
| }) | ||
| if (msg.event === 'toolkit_didLoadModule') { | ||
| telemetry.toolkit_didLoadModule.emit({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the If we have a separate metric for error, shouldn't we emit it in this case since we still received an error from the webview?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking of dropping I have it as a TODO to deprecate
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
? errors should be part of all metrics. There should not be a separate "foo_error" metric. |
||
| module: qChatModuleName, | ||
| result: 'Failed', | ||
| reasonDesc: msg.errorMessage, | ||
| }) | ||
| } else { | ||
| telemetry.webview_error.emit({ | ||
| webviewName: qChatModuleName, | ||
| result: 'Failed', | ||
| reasonDesc: msg.errorMessage, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is there a separate
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }) | ||
| } | ||
| return | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is done for all the webviews, will
webview_loadbe deprecated in favor of the more granular metrics?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup,
webview_xwill be deprecated for something liketoolkit_moduleX. So we'll also dropwebview_erroras well