From 830cf52e882cd616f9ff88646c7fbfff3f9612d7 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Thu, 10 Dec 2020 09:36:05 -0500 Subject: [PATCH] Closes #16075: Add distribution_id in telemetry startup metrics (#16821) (cherry picked from commit ca605d8a951beebb4e54c7ab880831ac4a52ea8a) --- app/metrics.yaml | 17 +++++++++++++++++ .../components/metrics/GleanMetricsService.kt | 9 +++++++++ docs/metrics.md | 1 + 3 files changed, 27 insertions(+) diff --git a/app/metrics.yaml b/app/metrics.yaml index bad326aba..8bdbdc044 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -685,6 +685,23 @@ metrics: notification_emails: - fenix-core@mozilla.com expires: "2021-08-01" + distribution_id: + type: string + lifetime: application + description: | + A string containing the distribution identifier. This is currently used + to identify installs from Mozilla Online. + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/16075 + data_reviews: + - https://github.com/mozilla-mobile/fenix/issues/16075 + data_sensitivity: + - technical + notification_emails: + - fenix-core@mozilla.com + expires: never top_sites_count: type: counter lifetime: application diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index b624e2906..d5d620fc6 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -9,6 +9,7 @@ import mozilla.components.service.fxa.manager.SyncEnginesStorage import mozilla.components.service.glean.Glean import mozilla.components.service.glean.private.NoExtraKeys import mozilla.components.support.base.log.logger.Logger +import org.mozilla.fenix.Config import org.mozilla.fenix.GleanMetrics.AboutPage import org.mozilla.fenix.GleanMetrics.Addons import org.mozilla.fenix.GleanMetrics.AppTheme @@ -724,6 +725,14 @@ class GleanMetricsService( mozillaProductDetector.getMozillaBrowserDefault(context)?.also { defaultMozBrowser.set(it) } + + distributionId.set( + when (Config.channel.isMozillaOnline) { + true -> "MozillaOnline" + false -> "Mozilla" + } + ) + mozillaProducts.set(mozillaProductDetector.getInstalledMozillaProducts(context)) adjustCampaign.set(context.settings().adjustCampaignId) diff --git a/docs/metrics.md b/docs/metrics.md index 2efab09a0..32a2c7b91 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -269,6 +269,7 @@ The following metrics are added to the ping: | metrics.close_tab_setting |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string that indicates the setting for tab closing: MANUAL, ONE_DAY, ONE_WEEK, ONE_MONTH |[1](https://github.com/mozilla-mobile/fenix/pull/15811#issuecomment-706402952)||2021-08-01 |2 | | metrics.default_browser |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Is Fenix the default browser? |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | | metrics.default_moz_browser |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The name of the default browser on device if and only if it's a Mozilla owned product |[1](https://github.com/mozilla-mobile/fenix/pull/1953/), [2](https://github.com/mozilla-mobile/fenix/pull/5216), [3](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |1, 2 | +| metrics.distribution_id |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string containing the distribution identifier. This is currently used to identify installs from Mozilla Online. |[1](https://github.com/mozilla-mobile/fenix/issues/16075)||never |1 | | metrics.has_open_tabs |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |A boolean that indicates if the user has any open NORMAL tabs. |[1](https://github.com/mozilla-mobile/fenix/pull/12024), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | | metrics.has_recent_pwas |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |A boolean that indicates if the user has recently used PWAs. See recently_used_pwa_count for the actual count. |[1](https://github.com/mozilla-mobile/fenix/pull/11982#pullrequestreview-437963817), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | | metrics.has_top_sites |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |A boolean that indicates if the user has top sites |[1](https://github.com/mozilla-mobile/fenix/pull/9556), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |