diff --git a/app/metrics.yaml b/app/metrics.yaml index 843d7f2f2..53fd5feb7 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -907,6 +907,7 @@ history: notification_emails: - fenix-core@mozilla.com expires: "2020-03-01" + reader_mode: available: type: event @@ -1112,4 +1113,21 @@ collections: - https://github.com/mozilla-mobile/fenix/pull/4539 notification_emails: - fenix-core@mozilla.com - expires: "2020-03-01" \ No newline at end of file + expires: "2020-03-01" + +experiments.metrics: + active_experiment: + type: string + description: > + Records the branch name of the active experiment, if the client is enrolled in the + `fenix-test-2019-08-05` experiment. This is intended to validate that the service-experiments + library properly matches clients to experiments and can take action based on a multi-branched + experiment. This is done by recording the experiment branch name in this string metric which + allows the experiment to be transparent and unobtrusive to the user. + bugs: + - 1543986 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1543986#c4 + notification_emails: + - mcooper@mozilla.com + expires: 2019-11-01 \ No newline at end of file diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index e2d63ea5b..e870a0b9a 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -31,6 +31,7 @@ import mozilla.components.support.rusthttp.RustHttpConfig import mozilla.components.support.rustlog.RustLog import org.mozilla.fenix.components.Components import org.mozilla.fenix.utils.Settings +import org.mozilla.fenix.GleanMetrics.ExperimentsMetrics import java.io.File @SuppressLint("Registered") @@ -80,6 +81,16 @@ open class FenixApplication : Application() { ) ) + // When the `fenix-test-2019-08-05` experiment is active, record its branch in Glean + // telemetry. This will be used to validate that the experiment system correctly enrolls + // clients and segments them into branches. Note that this will not take effect the first + // time the application has launched, since there won't be enough time for the experiments + // library to get a list of experiments. It will take effect the second time the + // application is launched. + Experiments.withExperiment("fenix-test-2019-08-05") { branchName -> + ExperimentsMetrics.activeExperiment.set(branchName) + } + setupLeakCanary() if (Settings.getInstance(this).isTelemetryEnabled) { components.analytics.metrics.start() diff --git a/docs/metrics.md b/docs/metrics.md index 667e80f70..87b50cff5 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -8,7 +8,7 @@ key type description - data deview + data review extras expires @@ -1057,5 +1057,13 @@ Data that is sent in the activation ping 2019-10-01 + + active_experiment + string + The branch name of the active experiment, if the client is enrolled in the `fenix-test-2019-08-05` experiment. + link + + 2019-11-01 +