Firefox/Input/Heartbeat

From MozillaWiki
< Firefox‎ | Input
Jump to: navigation, search

Heartbeat

Note: If you are a user and are looking for an explanation of what Heartbeat is, you are probably looking for Advocacy/heartbeat.

Summary

The telemetry experiments tool allows people to deploy add-ons to users based on user profile, version, OS, set sample rates, etc. We will be using this tool as a platform to deliver in-product polls that ask a for very simply happy/sad or star rating for a specified question. Gathering sentiment from our overall user base on a daily/weekly basis is what we are calling Firefox Heartbeat.

This page covers only the implementation work done on Input.

Status

History

  • v1
    • June 17th, 2014: Planning meeting conference call
    • July 1st, 2014: Will talked with Gregg
      • Going to build a prototype which requires an addon and some infrastructure on Input to handle incoming data.
      • It'll be minimal so we can tweak it easily as we flesh things out.
    • July 16th, 2014: Will started working on v1 implementation
    • August 12th, 2014: v1 backend implementation was finished
    • September 8th, 2014: Heartbeat was renamed to Pulse and it was decided that instead of sending data to Input, we'd send it to Bagheera. This project is hereby put on hold until that's finalized. If it is finalized, then this project will be canceled and code will be removed.
  • v2
    • October 31st, 2014: Pulse was renamed to Heartbeat. I decided v1 is done and successful. We're going to use Input for v2.
    • November 21nd, 2014: Finished up development for Heartbeat v2. There are still some minor bugs, but they're not in the critical path for pushing Heartbeat out.

Requirements

v1: signs of life

Requirements:

  1. API endpoint to capture specified data as JSON content: /api/v1/hb/
  2. captured data is put into a db table that's specific to heartbeat
  3. need to capture the following:
    • locale: the locale the user is using the product in (e.g. en-US)
    • platform: the operating system information (e.g. Windows 8)
    • product: the product name (e.g. Firefox)
    • version: the version (e.g. 33.0a1)
    • channel: the channel being used (e.g. beta)
    • poll: the slug of the poll being used; the poll must have been created on the system in question before posting heartbeat answers to it
    • answer: the answer the user gave (e.g. 1); for the most part this is an integer, but we're going to make this a text field to allow for different answer domains in the future
    • arbitrary additional contextual content

Anti-requirements:

  1. don't need to provide a way to access the data on Input--people will pull it from the db
  2. don't need to allow for multiple answers--all polls will be a single answer for now
  3. this is a prototype to get all our ducks in a row--it doesn't need to be perfect and we expect to make it better for the next iteration

Will's thoughts:

  1. Gregg asked for GET querystring params, but that has spam/abuse issues, so we're going to do POST content instead
  2. we'll toss all the arbitrary additional contextual content into a JSON blob and stick it in an extra field in the db; this means we won't be able to easily query this via SQL, but we can extract it other ways and if this turns out to be a problem, we can redo the db structure

Bugs:

Tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1052459

Full Query
ID Summary Priority Status
1033419 build backend for heartbeat project prototype P1 RESOLVED
1052460 add hb view to analyzer dashboard P1 RESOLVED
1052462 handle extra fields in hb api P1 RESOLVED

3 Total; 0 Open (0%); 3 Resolved (100%); 0 Verified (0%);


API docs: http://fjord.readthedocs.org/en/latest/api.html#posting-heartbeat-feedback-api-v1-hb

Prototype addon: https://github.com/gregglind/firefox-pulse

v2: beat harder

Requirements:

  1. API endpoint to capture specified data as JSON content: /api/v2/hb/
  2. captured data is put into a db table that's specific to heartbeat
  3. API should return a rollup of all errors with a packet all at once
  4. timestamps are milliseconds since epoch (which requires BigIntegerField)
  5. need a way to see hb data and hb errors for debugging the heartbeat client--these CANNOT be publicly available

Anti-requirements:

  1. no access to reading/analyzing the data via the Input website
  2. doesn't have to be forever-future-proof--just six-months-future-proof

Bugs:

Tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1092280

Full Query
ID Summary Priority Status
1092296 rebuild heartbeat v2 model P1 RESOLVED
1092299 build API endpoint for heartbeat v2 P1 RESOLVED
1092300 rewrite HB view on analyzer dashboard P1 RESOLVED
1103045 [heartbeat] hb survey view P3 RESOLVED
1103141 add "experiment_version" field to hb data model and api P1 RESOLVED
1108604 improve hb data view -- RESOLVED

6 Total; 0 Open (0%); 6 Resolved (100%); 0 Verified (0%);


API docs: TBD