You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
telemetry(webview): Emit toolkit_X module telemetry on auth webview (aws#6791)
## Problem:
With our telemetry, we do not know when the frontend webview UI has
actually loaded.
The current process looks like the following:
- We create a webview and set the HTML to load, but after that we do not
have a formal way to detect if the webview actually loaded the HTML/JS
successfully. We only know that the process started
(`toolkit_willOpenModule`)
## Solution:
Emit certain metrics during the webview loading process to get a better
idea of if the webview UI successfully completed its initial load.
- `toolkit_willOpenModule`, indicates intent to render a webview. It
does not mean the user is seeing anything.
- `toolkit_didLoadModule`, indicates the final result of loading the
webview
- We know a `result: Succeeded` when the frontend send a successful
message to the backend. It knows this by ensuring there were no errors
and that a certain HTML element can be found, then once the page
finishes its initial load it will send a success message to the backend.
- On `result: Failed`, what happens is a timer has timed out after 10
seconds. We assume that since there was no response from the frontend,
it failed to fully execute the HTML/JS.
- State is shared between `toolkit_willOpenModule` and
`toolkit_didLoadModule` so that we can connect them through telemetry.
This includes `traceId` and the `duration` which is the time between the
2 metrics.
This PR only applies to the Login and Reauth page for now, and future
Vue webviews will need to implement some things on their end to get this
functionality.
## TODO
- Generalize this solution in a more robust way for other webviews to
easily implement this functionality
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
---------
Signed-off-by: nkomonen-amazon <[email protected]>
0 commit comments