Bug 1918702 - Migrate telemetry events to use Glean APIs for browser.migration, r=chutten,migration-reviewers,mconley.

Differential Revision: https://phabricator.services.mozilla.com/D222504
This commit is contained in:
Florian Quèze
2024-09-20 13:58:17 +00:00
parent 1a1f0641c8
commit 57f89e2505
3 changed files with 310 additions and 20 deletions

View File

@@ -56,7 +56,7 @@ export class MigrationWizardChild extends JSWindowActorChild {
page: MigrationWizardConstants.PAGES.NO_BROWSERS_FOUND,
hasFileMigrators,
});
this.#sendTelemetryEvent("no_browsers_found");
this.#sendTelemetryEvent("noBrowsersFound");
} else {
this.setComponentState({
migrators,
@@ -96,7 +96,7 @@ export class MigrationWizardChild extends JSWindowActorChild {
if (!hasPermissions) {
if (event.detail.key == "safari") {
this.#sendTelemetryEvent("safari_perms");
this.#sendTelemetryEvent("safariPerms");
this.setComponentState({
page: MigrationWizardConstants.PAGES.SAFARI_PERMISSION,
});
@@ -147,7 +147,7 @@ export class MigrationWizardChild extends JSWindowActorChild {
// In theory, the migrator permissions might be requested on any
// platform - but in practice, this only happens on Linux, so that's
// why the event is named linux_perms.
this.#sendTelemetryEvent("linux_perms", {
this.#sendTelemetryEvent("linuxPerms", {
migrator_key: event.detail.key,
});
break;
@@ -260,9 +260,6 @@ export class MigrationWizardChild extends JSWindowActorChild {
}
}
// Event Telemetry extra arguments expect strings for every value, so
// now we coerce our "other" count into a string.
extraArgs.other = String(extraArgs.other);
return extraArgs;
}
@@ -284,12 +281,12 @@ export class MigrationWizardChild extends JSWindowActorChild {
* @returns {object}
*/
#recordBeginMigrationEvent(migrationDetails) {
this.#sendTelemetryEvent("browser_selected", {
this.#sendTelemetryEvent("browserSelected", {
migrator_key: migrationDetails.key,
});
if (migrationDetails.profile) {
this.#sendTelemetryEvent("profile_selected", {
this.#sendTelemetryEvent("profileSelected", {
migrator_key: migrationDetails.key,
});
}
@@ -297,10 +294,10 @@ export class MigrationWizardChild extends JSWindowActorChild {
let extraArgs = this.#constructExtraArgs(migrationDetails);
extraArgs.configured = String(Number(migrationDetails.expandedDetails));
this.#sendTelemetryEvent("resources_selected", extraArgs);
this.#sendTelemetryEvent("resourcesSelected", extraArgs);
delete extraArgs.configured;
this.#sendTelemetryEvent("migration_started", extraArgs);
this.#sendTelemetryEvent("migrationStarted", extraArgs);
return extraArgs;
}
@@ -326,7 +323,7 @@ export class MigrationWizardChild extends JSWindowActorChild {
) &&
!migrationDetails.safariPasswordFilePath
) {
this.#sendTelemetryEvent("safari_password_file");
this.#sendTelemetryEvent("safariPasswordFile");
this.setComponentState({
page: MigrationWizardConstants.PAGES.SAFARI_PASSWORD_PERMISSION,
});
@@ -337,7 +334,7 @@ export class MigrationWizardChild extends JSWindowActorChild {
migrationDetails,
extraArgs,
});
this.#sendTelemetryEvent("migration_finished", extraArgs);
this.#sendTelemetryEvent("migrationFinished", extraArgs);
this.#wizardEl.dispatchEvent(
new this.contentWindow.CustomEvent("MigrationWizard:DoneMigration", {

View File

@@ -191,14 +191,8 @@ export class MigrationWizardParent extends JSWindowActorParent {
* @param {object} args
* The data to pass to telemetry when the event is recorded.
*/
#recordEvent(type, args = null) {
Services.telemetry.recordEvent(
"browser.migration",
type,
"wizard",
null,
args
);
#recordEvent(type, args) {
Glean.browserMigration[type + "Wizard"].record(args);
}
/**

View File

@@ -40,3 +40,302 @@ browser.migration:
notification_emails:
- mconley@mozilla.com
expires: never
opened_wizard:
type: event
description: >
Recorded when the migration wizard opens.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.opened#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
telemetry_mirror: BrowserMigration_Opened_Wizard
no_browsers_found_wizard:
type: event
description: >
Recorded when the migration wizard reports that there are no
browsers to migrate from.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.no_browsers_found#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
telemetry_mirror: BrowserMigration_NoBrowsersFound_Wizard
browser_selected_wizard:
type: event
description: >
Recorded when the user selects a browser to migrate from.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.browser_selected#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the browser that was selected.
type: string
telemetry_mirror: BrowserMigration_BrowserSelected_Wizard
profile_selected_wizard:
type: event
description: >
Recorded when the user selects a profile to migrate from. If the
browser doesn't support multiple profiles, this will not be
recorded.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.profile_selected#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the browser that had a profile selected for it.
type: string
telemetry_mirror: BrowserMigration_ProfileSelected_Wizard
resources_selected_wizard:
type: event
description: >
Recorded when the user selects resources from the browser / profile
to import.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.resources_selected#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the browser that had resources selected for it.
type: string
history:
description: >
"1" if history was selected. "0" otherwise.
type: string
formdata:
description: >
"1" if form data was selected. "0" otherwise.
type: string
passwords:
description: >
"1" if passwords was selected. "0" otherwise.
type: string
bookmarks:
description: >
"1" if bookmarks were selected. "0" otherwise.
type: string
payment_methods:
description: >
"1" if payment methods were selected. "0" otherwise.
type: string
extensions:
description: >
"1" if extensions were selected. "0" otherwise.
type: string
other:
description: >
A count of the number of other resource types that were selected.
type: quantity
configured:
description: >
"1" if Variant 2 of the new Migration Wizard was being used, and the list of resources was expanded. "0" otherwise.
type: string
telemetry_mirror: BrowserMigration_ResourcesSelected_Wizard
linux_perms_wizard:
type: event
description: >
Recorded if the user is on Linux and the browser is installed in a
sandboxed environment that prevents it from reading other browser's
data, and the user is presented with instructions and an option to
grant the browser permission to read that other data.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.linux_perms#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the migrator that will perform the migration.
type: string
telemetry_mirror: BrowserMigration_LinuxPerms_Wizard
safari_perms_wizard:
type: event
description: >
Recorded if the user is on macOS, chose to migrate from Safari, and
was presented with the page of the wizard requesting permission to
read from the Safari profile folder.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.safari_perms#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
telemetry_mirror: BrowserMigration_SafariPerms_Wizard
safari_password_file_wizard:
type: event
description: >
Recorded if the user is on macOS, chose to migrate from Safari, and
was presented with the page of the wizard requesting to import
passwords from a file. This only gets recorded in the new migration
wizard.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.safari_password_file#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
telemetry_mirror: BrowserMigration_SafariPasswordFile_Wizard
migration_started_wizard:
type: event
description: >
Recorded when the user begins a migration.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.migration_started#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the migrator that will perform the migration.
type: string
history:
description: >
"1" if history is being migrated. "0" otherwise.
type: string
formdata:
description: >
"1" if form data is being migrated. "0" otherwise.
type: string
passwords:
description: >
"1" if passwords are being migrated. "0" otherwise.
type: string
bookmarks:
description: >
"1" if bookmarks are being migrated. "0" otherwise.
type: string
payment_methods:
description: >
"1" if payment methods are being migrated. "0" otherwise.
type: string
extensions:
description: >
"1" if extensions are being migrated. "0" otherwise.
type: string
other:
description: >
A count of the number of other resource types that are being migrated.
type: quantity
telemetry_mirror: BrowserMigration_MigrationStarted_Wizard
migration_finished_wizard:
type: event
description: >
Recorded when the user finishes a migration.
This event was generated to correspond to the Legacy Telemetry event
browser.migration.migration_finished#wizard.
bugs:
- https://bugzil.la/1824786
data_reviews:
- https://bugzil.la/1824786
notification_emails:
- mconley@mozilla.com
expires: never
extra_keys:
migrator_key:
description: >
The key of the migrator that will perform the migration.
type: string
history:
description: >
"1" if history was migrated. "0" otherwise.
type: string
formdata:
description: >
"1" if form data was migrated. "0" otherwise.
type: string
passwords:
description: >
"1" if passwords were migrated. "0" otherwise.
type: string
bookmarks:
description: >
"1" if bookmarks were migrated. "0" otherwise.
type: string
payment_methods:
description: >
"1" if payment methods were migrated. "0" otherwise.
type: string
extensions:
description: >
"1" if no extensions were matched, "2" if only some extensions were matched, "3" if all extensions were matched, and "0" if extensions weren't selected for migration.
type: string
other:
description: >
A count of the number of other resource types that were migrated.
type: quantity
telemetry_mirror: BrowserMigration_MigrationFinished_Wizard