Closed Bug 1490826 Opened 1 year ago Closed 1 year ago

about:welcome fetch from FxA /metrics-flow failing after browser start-up


(Firefox :: General, defect, P3)




Firefox 64
64.3 - Oct 12
Tracking Status
firefox62 --- wontfix
firefox63 + verified
firefox64 --- verified


(Reporter: loines, Assigned: vladikoff)


(Blocks 1 open bug)



(3 files)

and a fetch to the fxa metrics endpoint was implemented so that fxa form views on about:welcome could be measured. If the fetch is successful, the form should contain non-default `flow_id` and `flow_begin_time` values (see

However `flow_id` and `flow_begin_time` appear to have default (null) values when about:welcome loads on a new profile. 

1. create a new profile
2. wait for about:welcome to load
3. inspect source on email entry form

Expected result: 
`flow_id` and `flow_begin_time` should have non-default values.

Actual result:
<input name="flow_id" value="" type="hidden">
<input name="flow_begin_time" value="0" type="hidden">

HOWEVER: if you then open a new tab, navigate directly to about:welcome, and inspect source, the relevant parameters do appear to have actual values, e.g.

<input name="flow_id" value="87bdff375a6b80b883f6835b84ffcc613b910d648f72fc63ee22cd1ebab2487b" type="hidden">
<input name="flow_begin_time" value="1536784405695" type="hidden">

So it appears that the call to the fxa metrics endpoint is failing after about:welcome loads on startup, but not generally.

From the metrics point of view, the above would explain why we are receiving *some* about:welcome form views, but not at the volume that we would expect. see for example this chart:

The `fxa_email_first - view` event (tracks the unique form views of the email input form) should always have higher volume than `fxa_reg - view` and `fxa_login - view` since they are only viewable by users after they submit their email through the first form. So the chart above implies we are missing a majority of email form views on about:welcome.
Erica: can you review the bug above and see if it is something can be resolved and how much effort it would take to do?

Flags: needinfo?(ewright)
Blocks: 1448918
Sorry about the misleading links in the first post, the github links should actually be pointing here:
FYI I tried pulling down data on the telemetry event that is associated with this line on re:dash (data source = tiles, table = assa_masga_daily) but since the `value` field for that event is the string "FXA_METRICS_ERROR" and the `value` column for the re:dash dataset is integer type, I have a feeling that those events are being dropped on the floor during import to redshift/redash. 

If someone knows the s3 bucket for activity stream data I may be able to pull the events w/ spark to know how frequently they are happening.
:cmore looking into it - I'll let you know
Flags: needinfo?(ewright)
Priority: -- → P3
(In reply to Erica Wright [:ewright] from comment #4)
> :cmore looking into it - I'll let you know

Thanks, Erica. Let us know roughly the level of complexity of this fix.
Flags: needinfo?(ewright)
We spent some time on our side trying to figure out how the email form could be submit with default values. It seems like the two most likely scenarios are:

1. The call to /metrics-context has not yet completed when the user submits the form
2. The call to /metrics-context completed and failed.

We are part of the fortunate set of people running fast computers on fast connections. While testing however, I was on the train w/ a terrible connection and I was able to submit the form before the call to /metrics-context completed. I'm not sure if the call to /metrics-context is blocked for a bit for users of slower computers while Firefox is initially loading.

Vlad noticed in at least North America, the request to /metrics-context is done *after* 3 requests to get Pocket tiles. The call to /metrics-context was blocked by the requests to fetch Pocket tiles. Since the FxA screen is displayed as soon as the browser loads, could the call to /metrics-context be done before fetching the Pocket info?
I have only been able to duplicate this on release. I haven't managed on a local build of release, so it's proving very difficult to debug. However, I can add on to what Shane mentioned. When the values are successfully populated there are 4 calls, 3 to pocket for images, then 1 to `metrics-flow`. When it fails to populate the values, it seems it's not a failed fetch, the fetch just doesn't happen at all, there are only 3 requests showing up.
Flags: needinfo?(ewright)
Pasting :vladikoff's comment here from

> 7.6% of users who loaded about:welcome reported a "FXA_METRICS_ERROR" (from in release channel on Sep 13th

That seems pretty high to me, any theories what'd cause that failure?
After chatting with Erica about potential fixes for this we decided to gather more information about these errors.

Our proposal is to add several telemetry probes and uplift them into stable or beta:

- Probe to track a submit with empty params
- Probe to track a submit with good params
- Probe to track a skip button press with empty params
- Probe to track a skip button press with good params

:loines, can you think of anything else that will be useful here? Another related question, is there a way we can track down how Activity Stream is submitting the `screen.enter-email.view` Amplitude event in Firefox 62? (The main flow doesn't send a `form_type` right now, so the event is coming from elsewhere?)
Assignee: nobody → vlad
Flags: needinfo?(loines)
I think those are good events to have. 

In addition, relevant to shane's comment, would it be possible to log the response code as an event? We could log it including cases where its 200, or only in cases when its not 200. Whatever's best from a technical perspective.

That way if the fetch fails, we might have a better idea why.

As for your second question, I'm looking into it and will add here if i find anything
Flags: needinfo?(loines)
So, according to re:dash, which I trust more than amplitude, most of mysterious `screen.enter-email.view` form views are actually coming from 63, which I believe included the fix?
:vladikoff asked for a side-by-side comparison of the about:welcome email-first form views for re:dash and amplitude, segmented by version number:


As noted above, I believe re:dash has the more accurate numbers, which indicates that the form views are coming from beta 63 and not release 62, which is consistent with the form_type parameter having been added for 63 and not 62. I've done some investigating, but it is still not clear what is causing the version number in amplitude to be inaccurately reported. 

Note also that if we assume re:dash-63 = amplitude-62, then the absolute numbers don't line up exactly. I'm less worried about this because the identifier being counted here (`flow_id` for re:dash, and the amplitude user id for amplitude) isn't *always* the same (though in many cases they will be).
Hey Francois, Firefox Account folks are looking to add some telemetry to the about:welcome page in Activity Stream. Could you take a data review scan, please?

The change is documented at

Attachment #9012624 - Flags: review?(francois)
Comment on attachment 9012624 [details]

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

Yes, in and

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

Yes, either the telemetry setting or the Activity Stream telemetry setting in about:config.

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

Yes, Alex Davis (as per IRC conversation with rfkelly).

4) Using the **[category system of data types](** on the Mozilla wiki, what collection type of data do the requested measurements fall under?  **

Category 2.

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

Default ON, all channels.

6) Does the instrumentation include the addition of **any *new* identifiers** (whether anonymous or otherwise; e.g., username, random IDs, etc.  See the appendix for more details)?


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


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

No, permanent.
Attachment #9012624 - Flags: review?(francois) → review+
Nan, you requested release management tracking for the Firefox 63 release, is that because you will need to uplift a patch in beta?
Flags: needinfo?(najiang)
Yes, per :valdikoff, we'd like to get this patch uplifted to 63.

Since this patch is for Activity Stream, I believe we will bundle it with other 63 uplifts in A-S.
Flags: needinfo?(najiang)
Depends on: 1494427
Blocks: 1494427
No longer depends on: 1494427
Iteration: --- → 64.3 (Oct 12)
Target Milestone: Firefox 62 → Firefox 64
Closed: 1 year ago
Resolution: --- → FIXED
Attached file Uplift patch
Comment on attachment 9013837 [details]
Uplift patch

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Bug 1490826

User impact if declined: We will not be able to measure the error rate and the proper funnel cake conversion of the form. We cannot test this in Nightly because it does not use the `about:welcome` page directly.

Is this code covered by automated tests?: Yes

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: Yes

If yes, steps to reproduce: * Go to "about:welcome"
* Fill out the Firefox Accounts email form
* You should be redirected to the Firefox Accounts signup / signin form
* Check the telemetry events, it should now have a property `has_flow_params` in the form submit event.

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): It just modifies telemetry probes and adds some new logging. Half of the changes are improving the existing telemetry events. The rest are logging to errors that are thrown as part of the about:welcome form

String changes made/needed: None
Attachment #9013837 - Flags: approval-mozilla-beta?
Comment on attachment 9013837 [details]
Uplift patch

Uplift approved for 63 beta 12, thanks.
Attachment #9013837 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Contact: dolske
QA Contact: dolske
I have verified this bug fix with the latest nightly (Build ID 	20181015100128) and beta 63.0b13 (Build ID 20181008155858)on Windows 10, MacOS 10.14 and Ubuntu 16.04.

Telemetry events have a property `has_flow_params` in the form submit event.

TELEMETRY PING: {"locale":"en-US","topic":"activity-stream","client_id":"efdbdb11-24eb-442a-abc6-7f673474a874","version":"63.0","release_channel":"beta","addon_version":"20181008155858","user_prefs":63,"session_id":"{fde69e24-7dda-437f-b82e-d1d79d5b9702}","page":"about:welcome","event":"SUBMIT_EMAIL","value":{"has_flow_params":true},"action":"activity_stream_user_event","shield_id":"pref-flip-activity-stream-cfr-1491379:Control;","profile_creation_date":17819,"region":"US"}
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.