Commit ad4f2947 authored by Mugurell's avatar Mugurell Committed by Grisha Kruglov
Browse files

For #17869 - New AndroidKeystoreExperiment telemetry

parent 104455ab
......@@ -4533,3 +4533,104 @@ engine:
- fenix-core@mozilla.com
- skaspari@mozilla.com
expires: "2021-12-31"
android_keystore_experiment:
experiment_failure:
type: event
description: |
Records an instance of an unexpected failure during the experiment
extra_keys:
failure_exception:
description: |
Exception class associated with an unexpected failure of this
experiment, not caught by the other failure handlers.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
get_failure:
type: event
description: |
Unexpected failure when trying to read from secure prefs.
extra_keys:
failure_exception:
description: |
Exception class associated with an unexpected failure of this
experiment.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
get_result:
type: event
description: |
Success when trying to read from secure prefs.
extra_keys:
result:
description: |
Result code identifying whether the read operation returned the
expected value or not.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
write_failure:
type: event
description: |
Unexpected failure when trying to write to secure prefs.
extra_keys:
failure_exception:
description: |
Exception class associated with an unexpected failure of this
experiment.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
write_success:
type: event
description: |
Success in writing to secure prefs.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
reset:
type: event
description: |
An experiment failed, and was reset to run again in the future from a
blank state.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/17869
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395
data_sensitivity:
- technical
notification_emails:
- fenix-core@mozilla.com
expires: "2021-09-01"
......@@ -9,6 +9,7 @@ import mozilla.components.browser.errorpages.ErrorType
import mozilla.components.browser.state.search.SearchEngine
import mozilla.components.feature.top.sites.TopSite
import org.mozilla.fenix.GleanMetrics.Addons
import org.mozilla.fenix.GleanMetrics.AndroidKeystoreExperiment
import org.mozilla.fenix.GleanMetrics.AppTheme
import org.mozilla.fenix.GleanMetrics.Autoplay
import org.mozilla.fenix.GleanMetrics.Collections
......@@ -221,6 +222,25 @@ sealed class Event {
get() = hashMapOf(TopSites.swipeCarouselKeys.page to page.toString())
}
data class SecurePrefsExperimentFailure(val failureException: String) : Event() {
override val extras =
mapOf(AndroidKeystoreExperiment.experimentFailureKeys.failureException to failureException)
}
data class SecurePrefsGetFailure(val failureException: String) : Event() {
override val extras =
mapOf(AndroidKeystoreExperiment.getFailureKeys.failureException to failureException)
}
data class SecurePrefsGetSuccess(val successCode: String) : Event() {
override val extras =
mapOf(AndroidKeystoreExperiment.getResultKeys.result to successCode)
}
data class SecurePrefsWriteFailure(val failureException: String) : Event() {
override val extras =
mapOf(AndroidKeystoreExperiment.writeFailureKeys.failureException to failureException)
}
object SecurePrefsWriteSuccess : Event()
object SecurePrefsReset : Event()
data class TopSiteLongPress(val type: TopSite.Type) : Event() {
override val extras: Map<TopSites.longPressKeys, String>?
get() = hashMapOf(TopSites.longPressKeys.type to type.name)
......
......@@ -15,6 +15,7 @@ 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.AndroidKeystoreExperiment
import org.mozilla.fenix.GleanMetrics.AppTheme
import org.mozilla.fenix.GleanMetrics.Autoplay
import org.mozilla.fenix.GleanMetrics.BannerOpenInApp
......@@ -750,6 +751,29 @@ private val Event.wrapper: EventWrapper<*>?
{ BannerOpenInApp.goToSettings.record(it) }
)
is Event.SecurePrefsExperimentFailure -> EventWrapper(
{ AndroidKeystoreExperiment.experimentFailure.record(it) },
{ AndroidKeystoreExperiment.experimentFailureKeys.valueOf(it) }
)
is Event.SecurePrefsGetFailure -> EventWrapper(
{ AndroidKeystoreExperiment.getFailure.record(it) },
{ AndroidKeystoreExperiment.getFailureKeys.valueOf(it) }
)
is Event.SecurePrefsGetSuccess -> EventWrapper(
{ AndroidKeystoreExperiment.getResult.record(it) },
{ AndroidKeystoreExperiment.getResultKeys.valueOf(it) }
)
is Event.SecurePrefsWriteFailure -> EventWrapper(
{ AndroidKeystoreExperiment.writeFailure.record(it) },
{ AndroidKeystoreExperiment.writeFailureKeys.valueOf(it) }
)
is Event.SecurePrefsWriteSuccess -> EventWrapper<NoExtraKeys>(
{ AndroidKeystoreExperiment.writeSuccess.record(it) }
)
is Event.SecurePrefsReset -> EventWrapper<NoExtraKeys>(
{ AndroidKeystoreExperiment.reset.record(it) }
)
// Don't record other events in Glean:
is Event.AddBookmark -> null
is Event.OpenedBookmark -> null
......
......@@ -23,6 +23,7 @@ import mozilla.components.feature.media.facts.MediaFacts
import mozilla.components.feature.prompts.dialog.LoginDialogFacts
import mozilla.components.feature.pwa.ProgressiveWebAppFacts
import mozilla.components.feature.top.sites.facts.TopSitesFacts
import mozilla.components.lib.dataprotect.SecurePrefsReliabilityExperiment
import mozilla.components.support.base.Component
import mozilla.components.support.base.facts.Action
import mozilla.components.support.base.facts.Fact
......@@ -76,6 +77,7 @@ internal class DebugMetricController(
}
@VisibleForTesting
@Suppress("LargeClass")
internal class ReleaseMetricController(
private val services: List<MetricsService>,
private val isDataTelemetryEnabled: () -> Boolean,
......@@ -267,6 +269,26 @@ internal class ReleaseMetricController(
}
null
}
Component.LIB_DATAPROTECT to SecurePrefsReliabilityExperiment.Companion.Actions.EXPERIMENT -> {
Event.SecurePrefsExperimentFailure(metadata?.get("javaClass") as String? ?: "null")
}
Component.LIB_DATAPROTECT to SecurePrefsReliabilityExperiment.Companion.Actions.GET -> {
if (SecurePrefsReliabilityExperiment.Companion.Values.FAIL.v == value?.toInt()) {
Event.SecurePrefsGetFailure(metadata?.get("javaClass") as String? ?: "null")
} else {
Event.SecurePrefsGetSuccess(value ?: "")
}
}
Component.LIB_DATAPROTECT to SecurePrefsReliabilityExperiment.Companion.Actions.WRITE -> {
if (SecurePrefsReliabilityExperiment.Companion.Values.FAIL.v == value?.toInt()) {
Event.SecurePrefsWriteFailure(metadata?.get("javaClass") as String? ?: "null")
} else {
Event.SecurePrefsWriteSuccess
}
}
Component.LIB_DATAPROTECT to SecurePrefsReliabilityExperiment.Companion.Actions.RESET -> {
Event.SecurePrefsReset
}
else -> null
}
......
......@@ -52,6 +52,12 @@ The following metrics are added to the ping:
| about_page.support_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Support" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 |
| addons.open_addon_in_toolbar_menu |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user interacted with an installed add-on in the toolbar menu |[1](https://github.com/mozilla-mobile/fenix/pull/8318), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)|<ul><li>addon_id: The id of the add-on that was interacted with in the toolbar menu </li></ul>|2021-04-01 |2 |
| addons.open_addons_in_settings |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user accessed "Add-ons" from the Settings |[1](https://github.com/mozilla-mobile/fenix/pull/8318), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)||2021-04-01 |2 |
| android_keystore_experiment.experiment_failure |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Records an instance of an unexpected failure during the experiment |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)|<ul><li>failure_exception: Exception class associated with an unexpected failure of this experiment, not caught by the other failure handlers. </li></ul>|2021-09-01 |1 |
| android_keystore_experiment.get_failure |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Unexpected failure when trying to read from secure prefs. |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)|<ul><li>failure_exception: Exception class associated with an unexpected failure of this experiment. </li></ul>|2021-09-01 |1 |
| android_keystore_experiment.get_result |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Success when trying to read from secure prefs. |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)|<ul><li>result: Result code identifying whether the read operation returned the expected value or not. </li></ul>|2021-09-01 |1 |
| android_keystore_experiment.reset |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |An experiment failed, and was reset to run again in the future from a blank state. |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)||2021-09-01 |1 |
| android_keystore_experiment.write_failure |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Unexpected failure when trying to write to secure prefs. |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)|<ul><li>failure_exception: Exception class associated with an unexpected failure of this experiment. </li></ul>|2021-09-01 |1 |
| android_keystore_experiment.write_success |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Success in writing to secure prefs. |[1](https://github.com/mozilla-mobile/fenix/pull/18333#pullrequestreview-612447395)||2021-09-01 |1 |
| app_theme.dark_theme_selected |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user selected Dark Theme |[1](https://github.com/mozilla-mobile/fenix/pull/7968), [2](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877)|<ul><li>source: The source from where dark theme was selected. The source can be 'SETTINGS' or 'ONBOARDING' </li></ul>|2021-04-01 |2 |
| autoplay.setting_changed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user changed their autoplay setting to either block_cellular, block_audio, or block_all. |[1](https://github.com/mozilla-mobile/fenix/pull/13041#issuecomment-665777411)|<ul><li>autoplay_setting: The new setting for autoplay: block_cellular, block_audio, or block_all. </li></ul>|2021-08-01 |2 |
| autoplay.visited_setting |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user visited the autoplay settings screen |[1](https://github.com/mozilla-mobile/fenix/pull/13041#issuecomment-665777411)||2021-08-01 |2 |
......@@ -315,8 +321,8 @@ The following metrics are added to the ping:
| perf.awesomebar.session_suggestions |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |Duration of a session awesomebar suggestion query. |[1](https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979)||2020-11-15 |1, 2 |
| perf.awesomebar.shortcuts_suggestions |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |Duration of a shortcuts awesomebar suggestion query. |[1](https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979)||2020-11-15 |1, 2 |
| perf.awesomebar.synced_tabs_suggestions |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |Duration of a synced tabs awesomebar suggestion query. |[1](https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979)||2020-11-15 |1, 2 |
| perf.startup.application_on_create |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |The duration of `FenixApplication.onCreate` in the main process. |[1](todo)||2021-08-11 |1 |
| perf.startup.home_activity_on_create |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |The duration of `HomeActivity.onCreate`. |[1](todo)||2021-08-11 |1 |
| perf.startup.application_on_create |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |The duration of `FenixApplication.onCreate` in the main process. |[1](https://github.com/mozilla-mobile/fenix/pull/17973#issue-572183889)||2021-08-11 |1 |
| perf.startup.home_activity_on_create |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |The duration of `HomeActivity.onCreate`. |[1](https://github.com/mozilla-mobile/fenix/pull/17973#issue-572183889)||2021-08-11 |1 |
| preferences.accessibility_services |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has touch exploration or switch services enabled. These are built into the Android OS, not Fenix prefs. default: "" |[1](https://github.com/mozilla-mobile/fenix/pull/11211), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| preferences.open_links_in_a_private_tab |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has enabled open links in a private tab. default: false |[1](https://github.com/mozilla-mobile/fenix/pull/11211), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| preferences.open_links_in_app |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has the open links in apps feature enabled. default: false |[1](https://github.com/mozilla-mobile/fenix/pull/11446), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment