Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Introduce Glean.js for collecting data #505

Merged
merged 14 commits into from Apr 8, 2021

Conversation

Dexterp37
Copy link
Contributor

@Dexterp37 Dexterp37 commented Mar 18, 2021

Fixes #117

This PR adds Glean.js as a dependency and enables documentation and metric code generation at build time, using the 'glean' command.

Important reviewer notes:

  • Glean.js will always submit data once initialized with upload = true. This only happens after user enrols in Rally.
  • This PR exclusively stores the rally id as a metric in Glean. Other pings and metrics (to be at feature parity with the current implementation) will happen in a follow-up PR.

TODO:

  • Add tests.
  • Initialize Glean.
  • Submit the onboarding ping. (Will happen as a separate PR)
  • Collect study_join_selected from this spreadsheet. (Will happen as a separate PR)
  • Request a data review. (Will happen after this is reviewed, before merging)
  • Collect one metric.

Checklist for reviewer:

  • The description should reference a bug or github issue, if relevant.
  • There must be a CHANGELOG.md entry for any non-test change.
  • Any change to the NPM commands must be carefully reviewed to make sure it won't break the Add-ons pipeline.
  • Any version increase must follow the release process.

@Dexterp37 Dexterp37 force-pushed the gleanjs branch 2 times, most recently from 5fcf66e to 5d84744 Compare March 22, 2021 14:26
@Dexterp37
Copy link
Contributor Author

This is now blocked by rollup/plugins#843

@Dexterp37 Dexterp37 self-assigned this Mar 25, 2021
This ensures that the docs and the metrics code
is regenerated when building the core-addon.
This guarantees Glean files get generated.
This fixes the warning (!) Plugin node-resolve: preferring built-in module 'util' over local alternative at '/home/dexter/rally-core-addon/node_modules/util/util.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
Glean is disabled by default when building the core-addon.
The config-enable-glean option enables Glean. Note that,
if Glean is not initialized, no metric recording happens,
even if the Glean specific metrics APIs are called.
@Dexterp37 Dexterp37 marked this pull request as ready for review March 26, 2021 15:19
Copy link
Contributor

@brizental brizental left a comment

Choose a reason for hiding this comment

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

From a Glean integration standpoint this LGTM. Very exciting to see this reaching this status. 🎉

Unfortunately this "hack" is required because the add-ons
pipeline does not enable consumers to customize the installed
packages.
In the spirit of keeping this PR simple, this commit
removes the pings definition file.
@Dexterp37 Dexterp37 requested a review from rhelmer April 4, 2021 14:03
@marniepw
Copy link
Member

marniepw commented Apr 6, 2021

@rhelmer just a reminder about this one...thanks!

Copy link
Contributor

@rhelmer rhelmer left a comment

Choose a reason for hiding this comment

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

lgtm! I assume this is so simple because glean.js is doing most of the heavy lifting (well, and those bits aren't implemented that you mentioned in the top comment).

import { promisify } from "util";

// Define an async/await version of "exec".
const execAsync = promisify(exec.exec);
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh, why do you want this to be async? Doesn't seem like it matters here, and it's not being await'd or anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No real reason, it was copy 🍝 !

@Dexterp37 Dexterp37 merged commit a397fd8 into mozilla-rally:master Apr 8, 2021
@Dexterp37 Dexterp37 deleted the gleanjs branch April 8, 2021 12:53
@Dexterp37
Copy link
Contributor Author

Request for data collection review form

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 PR does not add any new data collection to the Core Add-on. Instead, it introduces Glean.js and stores the "rally id" in Glean.js.

  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.
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?

Data collection currently happens using legacy telemetry in Firefox. We're migrating to Glean.

  1. Can current instrumentation answer these questions?

Yes, but we need to migrate to Glean.js to further evolve Rally.

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

This PR does not add any new data point. The Rally id/Pioneer id was already data-reviewed for Pioneer.

  1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.

Documentation is generated by Glean and included in this PR.

  1. How long will this data be collected? Choose one of the following:
  • I want to permanently monitor this data. Ted Han (than@mozilla.com) will own the data (and the whole rally team).
  1. What populations will you measure?

All the populations currently covered by the Rally policy.

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

Collection is only enabled after user enrolls in Rally after onboarding.

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

Data will be analysed via notebooks to understand how the core addon behaves in the wild.

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

With key partners through their relative secure environments.

  1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection? If so:

No. Data will be stored and analysed using internal tools.

@chutten
Copy link

chutten commented Apr 8, 2021

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.

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

Yes. This collection is part of Rally which can be turned on and off.

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

Yes, Ted Han is responsible.

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

Mixed categories. This is the addition of a data collection system (Glean.js) not a specific data collection.

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

Default off. Rally requires opt-in.

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+

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.

Collect data using Glean.js
5 participants