Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Introduce Glean SDK #1085

Merged
merged 5 commits into from
Dec 2, 2019
Merged

Introduce Glean SDK #1085

merged 5 commits into from
Dec 2, 2019

Conversation

jhugman
Copy link
Contributor

@jhugman jhugman commented Nov 22, 2019

This is the first part of #127.

This PR adds the Glean SDK as a dependency and enables it. It additionally adds basic documentation in the docs/metrics.md.

It replaces #1073.

It puts Glean in a GleanTelemetryStore and hooks it up to the setting for toggling sendUsageData.

It also puts this behind a FeatureFlag so we can still release without landing the rest of the Glean work.

@jhugman jhugman requested a review from a team as a code owner November 22, 2019 18:22
@jhugman jhugman mentioned this pull request Nov 22, 2019
2 tasks
@jhugman
Copy link
Contributor Author

jhugman commented Nov 22, 2019

Request for data collection review form

/cc @chutten.

All questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.

  1. What questions will you answer with this data?

This enables telemetry from the Glean SDK and the firefox-accounts components.

  1. Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements? Some example responses:
  • Establish baselines or measure changes in product or platform quality or performance.
  • Provide information essential for advancing a business objective such as supporting OKRs.
  • Determine whether a product or platform change has an effect on user or browser behavior.

We need Glean to replace our legacy telemetry system. Telemetry is needed to measure product performance.

  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?

We are currently using the service-telemetry android-component, which is now deprecated. The Glean SDK will be the only supported library going forward.

  1. Can current instrumentation answer these questions?

Current instrumentation is deprecated in favour of the Glean SDK.

  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories on the Mozilla wiki.

With this proposal, no extra data is being collected that has not been data-reviewed already, or that is collected by default by the Glean SDK or the firefox-accounts component.

  1. How long will this data be collected? Choose one of the following:
  • This is scoped to a time-limited experiment/project until date MM-DD-YYYY.
  • I want this data to be collected for 6 months initially (potentially renewable).
  • I want to permanently monitor this data. (put someone’s name here)

This data is collected as a pre-requisite for using the Glean SDK and firefox-accounts.

The Lockwise team want to use these libraries on an ongoing basis.

  1. What populations will you measure?
  • Which release channels?
  • Which countries?
  • Which locales?
  • Any other filters?

Please describe in detail below.

The populations included are the entire release population.

  1. If this data collection is default on, what is the opt-out mechanism for users?

Data collection is default on for the populations not covered by the General Data Protection Regulation.

A toggle setting in the settings screen is already provided.

  1. Please provide a general description of how you will analyze this data.

The data collected will be used to inform product decisions using a series of queries on redash.

  1. Where do you intend to share the results of your analysis?

All analysis will be published on internal dashboards, via redash.

  1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection? If so:
  • Are you using that on the Mozilla backend? Or going directly to the third-party?

No.

@jhugman jhugman force-pushed the jhugman/173-add-glean-to-lockwise branch 3 times, most recently from c6a1c21 to c7321bc Compare November 26, 2019 13:18
docs/metrics.md Outdated
@@ -179,14 +180,25 @@ https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/c
* `value`: null
* `extras`: null

## Mozilla Glean SDK

Lockwise for Android uses the [Glean SDK](https://mozilla.github.io/glean/book/index.html) to collect telemetry. The Glean SDK provides a handful of [pings and metrics out of the box](https://mozilla.github.io/glean/book/user/pings/index.html). The data review for using the Glean SDK is available at [this link](TODO).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated after the data review is complete.

docs/metrics.md Outdated

|Name|Description|Collected metrics|Data review|
|---|---|---|---|
|[Firefox accounts](https://github.com/mozilla-mobile/android-components/tree/master/components/service/firefox-accounts)|A library for integrating with Firefox Accounts.| [docs](https://github.com/mozilla-mobile/android-components/blob/master/components/support/sync-telemetry/docs/metrics.md)| [review](TODO) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated after the data review is complete.

Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking time doing this. It looks good to me. I'm only holding back the "r+" as a reminder that data_review links need to be adjusted after data review is provided.

As discussed, let's also deal with local developer telemetry/debug suffix id as soon as possible after merging this :)

Note Please re-flag me after data-review is complete and the PR is updated.

@chutten
Copy link

chutten commented Nov 26, 2019

PRELIMINARY NOTES:
Sorry for the delay on this. I'm used to Data Collection Reviews coming as attachments on bugs in Bugzilla.

DATA COLLECTION REVIEW RESPONSE:

Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?

Yes. The Glean SDK documents its collections in its book. (application-services does not appear to presently use the Glean SDK to send metrics)

Is there a control mechanism that allows the user to turn the data collection on and off?

Yes. This setting can be controlled from within the app.

If the request is for permanent data collection, is there someone who will monitor the data over time?

Yes, David Durst is responsible.

Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Category 2, Interaction. (backgrounding the app is interaction)

Is the data collection request for default-on or default-off?

Default on for all channels.

Does the instrumentation include the addition of any new identifiers?

No.

Is the data collection covered by the existing Firefox privacy notice?

Yes.

Does there need to be a check-in in the future to determine whether to renew the data?

No. This collection is permanent.


Result: datareview+

@chutten
Copy link

chutten commented Nov 26, 2019

Travis shows me the error of my assumptions and points out that sync uses Glean and its metrics are documented there.

The Data Review passes regardless.

Dexterp37 and others added 5 commits November 27, 2019 16:40
 * ensure uload enabled setting is respected before the initialization.
 * Include test to demonstrate this.
 * change the emphasis of Feature Flag so we can deprecate the legacy telemetry service.
 * Move telemetry service registeration dispatch events to `injectContext` so as to be switchable with Feature Flag.
@jhugman jhugman force-pushed the jhugman/173-add-glean-to-lockwise branch from c7321bc to 01c8e65 Compare November 27, 2019 16:42
@jhugman jhugman dismissed Dexterp37’s stale review November 27, 2019 16:45

Data-review+, with link to review in metrics.md.

@jhugman jhugman merged commit 096cdac into master Dec 2, 2019
@jhugman jhugman deleted the jhugman/173-add-glean-to-lockwise branch December 2, 2019 14:03
eliserichards pushed a commit that referenced this pull request Dec 13, 2019
* Add the Glean SDK as a dependency

* Document the Glean SDK data collection

* Add GleanTelemetryStore

* Address Glean reviewer feedback

 * ensure uload enabled setting is respected before the initialization.
 * Include test to demonstrate this.
 * change the emphasis of Feature Flag so we can deprecate the legacy telemetry service.
 * Move telemetry service registeration dispatch events to `injectContext` so as to be switchable with Feature Flag.

* Add link to data-review
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants