Bug 1889123 - Add a ping / metrics to help measure accounts usage. data-review=mreid, r=markh,firefox-desktop-core-reviewers ,data-stewards,chutten

Differential Revision: https://phabricator.services.mozilla.com/D206820
This commit is contained in:
Mike Conley 2024-06-18 14:15:28 +00:00
Родитель 4fb72992d4
Коммит f38e7db9bf
5 изменённых файлов: 94 добавлений и 1 удалений

Просмотреть файл

@ -1995,6 +1995,10 @@ pref("identity.fxaccounts.commands.missed.fetch_interval", 86400);
// commands from other FxA clients
pref("identity.fxaccounts.commands.remoteTabManagement.enabled", false);
// Controls whether or not the client association ping has values set on it
// when the sync-ui-state:update notification fires.
pref("identity.fxaccounts.telemetry.clientAssociationPing.enabled", false);
// Note: when media.gmp-*.visible is true, provided we're running on a
// supported platform/OS version, the corresponding CDM appears in the
// plugins list, Firefox will download the GMP/CDM if enabled, and our

Просмотреть файл

@ -28,6 +28,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
ClientID: "resource://gre/modules/ClientID.sys.mjs",
CloseRemoteTab: "resource://gre/modules/FxAccountsCommands.sys.mjs",
ContentRelevancyManager:
"resource://gre/modules/ContentRelevancyManager.sys.mjs",
@ -158,6 +159,13 @@ if (AppConstants.ENABLE_WEBDRIVER) {
lazy.RemoteAgent = { running: false };
}
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"CLIENT_ASSOCIATION_PING_ENABLED",
"identity.fxaccounts.telemetry.clientAssociationPing.enabled",
false
);
const PREF_PDFJS_ISDEFAULT_CACHE_STATE = "pdfjs.enabledCache.state";
const PRIVATE_BROWSING_BINARY = "private_browsing.exe";
@ -1280,9 +1288,20 @@ BrowserGlue.prototype = {
}
break;
}
case "sync-ui-state:update":
case "sync-ui-state:update": {
this._updateFxaBadges(lazy.BrowserWindowTracker.getTopWindow());
if (lazy.CLIENT_ASSOCIATION_PING_ENABLED) {
let fxaState = lazy.UIState.get();
if (fxaState.status == lazy.UIState.STATUS_SIGNED_IN) {
Glean.clientAssociation.uid.set(fxaState.uid);
Glean.clientAssociation.legacyClientId.set(
lazy.ClientID.getCachedClientID()
);
}
}
break;
}
case "handlersvc-store-initialized":
// Initialize PdfJs when running in-process and remote. This only
// happens once since PdfJs registers global hooks. If the PdfJs

Просмотреть файл

@ -0,0 +1,45 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
- 'Firefox :: Firefox Accounts'
client_association:
uid:
type: string
description: |
The Mozilla Account UID associated with the user.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
data_sensitivity:
- highly_sensitive
notification_emails:
- mreid@mozilla.com
- mconley@mozilla.com
expires: never
send_in_pings:
- fx-accounts
legacy_client_id:
type: uuid
description: |
The legacy Telemetry client ID associated with this user profile.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
data_sensitivity:
- highly_sensitive
notification_emails:
- mreid@mozilla.com
- mconley@mozilla.com
expires: never
send_in_pings:
- fx-accounts

Просмотреть файл

@ -0,0 +1,23 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
$schema: moz://mozilla.org/schemas/glean/pings/2-0-0
fx-accounts:
description: |
A ping for information about Mozilla Account usage. Sent at the same cadence
as the baseline ping.
include_client_id: true
send_if_empty: false
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1889123
notification_emails:
- mreid@mozilla.com
- mconley@mozilla.com
metadata:
ping_schedule:
- baseline

Просмотреть файл

@ -70,6 +70,7 @@ firefox_desktop_metrics = [
"browser/modules/metrics.yaml",
"dom/media/platforms/wmf/metrics.yaml",
"dom/privateattribution/metrics.yaml",
"services/fxaccounts/metrics.yaml",
"toolkit/components/contentrelevancy/metrics.yaml",
"toolkit/components/crashes/metrics.yaml",
"toolkit/components/nimbus/metrics.yaml",
@ -133,6 +134,7 @@ firefox_desktop_pings = [
"browser/components/search/pings.yaml",
"browser/components/urlbar/pings.yaml",
"browser/modules/pings.yaml",
"services/fxaccounts/pings.yaml",
"toolkit/components/crashes/pings.yaml",
"toolkit/components/resistfingerprinting/pings.yaml",
"toolkit/components/telemetry/pings.yaml",