Open Bug 1712990 Opened 5 years ago Updated 3 years ago

Clarify meaning of "fennec" in products in telemetry definition

Categories

(Toolkit :: Telemetry, task, P4)

task

Tracking

()

People

(Reporter: robwu, Unassigned)

References

Details

https://searchfox.org/mozilla-central/rev/1df3b4b4d27d413675fb66f375230cb25d636450/toolkit/components/telemetry/docs/collection/scalars.rst#170 current states:

  • products: A list of products the scalar can be recorded on. Currently supported values are:

    • firefox - Collected in Firefox Desktop for submission via Firefox Telemetry.
    • fennec - Collected in Firefox for Android for submission via Firefox Mobile Telemetry.

"fennec" was the code name for Firefox for Android version 78 and earlier. At some point there was "geckoview" in the product list (but that got removed in bug 1620656; it's still mentioned at toolkit/components/telemetry/docs/start/report-gecko-telemetry-in-glean.rst though).

To avoid confusion (i.e. to confirm that "fennec" should indeed be used to collect telemetry on GeckoView-based Firefox for Android), could you add an explicit note that "fennec" is used despite the app not being Fennec? E.g.

  • fennec - Collected in Firefox for Android (Fenix) for submission via Firefox Mobile Telemetry.

Note the addition of (Fenix) between braces, to emphasize that "Firefox for Android" is not Fennec.

(In reply to Rob Wu [:robwu] from comment #0)

https://searchfox.org/mozilla-central/rev/1df3b4b4d27d413675fb66f375230cb25d636450/toolkit/components/telemetry/docs/collection/scalars.rst#170 current states:

  • products: A list of products the scalar can be recorded on. Currently supported values are:

    • firefox - Collected in Firefox Desktop for submission via Firefox Telemetry.
    • fennec - Collected in Firefox for Android for submission via Firefox Mobile Telemetry.

"fennec" was the code name for Firefox for Android version 78 and earlier. At some point there was "geckoview" in the product list (but that got removed in bug 1620656; it's still mentioned at toolkit/components/telemetry/docs/start/report-gecko-telemetry-in-glean.rst though).

To avoid confusion (i.e. to confirm that "fennec" should indeed be used to collect telemetry on GeckoView-based Firefox for Android), could you add an explicit note that "fennec" is used despite the app not being Fennec? E.g.

  • fennec - Collected in Firefox for Android (Fenix) for submission via Firefox Mobile Telemetry.

Note the addition of (Fenix) between braces, to emphasize that "Firefox for Android" is not Fennec.

fennec does indeed specifically refer to the Fennec-codenamed Firefox for Android 78 and below. That value is now deprecated and shouldn't be used. Since Fennec lived on rather longer than the migration to Fenix made it look (due to its support for HW that Fenix didn't/doesn't support) I couldn't remove the documentation or value at that time. (It's still there because it hasn't really come up that often since)

To record Telemetry in Fenix (Firefox for Android powered by Geckoview and android-components and stuff) is presently a whole other thing that is somewhat complicated which uses the value geckoview_streaming and will soon (ie, hitting Nightly in the next week or two) be replaced by the very straightforward "Anything recorded in and reported by Gecko is reported by any products that use Gecko and Glean, which includes Firefox Desktop and Firefox for Android" via FOG granting Firefox Desktop access to Glean (like the rest of Mozilla's projects that perform data collection).

The geckoview value is an even more complicated thing that we successfully deprecated. Thank goodness. It had some serious performance problems.

Does that help?

Flags: needinfo?(rob)

By "Fenix", I meant code that ends up in Fenix, which is not necessarily restricted to Java code.
I was looking for the answer to the question "If I want to ensure that telemetry is reported for toolkit code (i.e. common code for all platforms, desktop and Android), what should be in the products list?"

If fennec shouldn't be used, why is it still used? Does it do anything or is it just dead code?

Flags: needinfo?(rob)

And "thunderbird" is also listed in Scalars.yaml but not documented in scalars.rst.

(In reply to Rob Wu [:robwu] from comment #2)

By "Fenix", I meant code that ends up in Fenix, which is not necessarily restricted to Java code.

Oh good, that's also how I use it.

I was looking for the answer to the question "If I want to ensure that telemetry is reported for toolkit code (i.e. common code for all platforms, desktop and Android), what should be in the products list?"

At this present time you require Geckoview Streaming Telemetry (which is the "whole other thing that is somewhat complicated" I mentioned above) as well as Firefox Telemetry. In short you need record_in_products: ["firefox", "geckoview_streaming"] (plus thunderbird unless you're sure your code isn't present in Thunderbird, otherwise your tests will break when run against their builds). You'll also need to read the guide which has some additional steps. And you will also likely need some chats with me or someone else on #telemetry to help you through this as though we aimed to have it be straightforward, that doesn't mean it's simple (or that it supports everything (notably events.)).

As soon as Geckoview support for FOG lands (targeting Fx91 next week) to add instrumentation that records and reports everywhere that Gecko and Glean are together you won't use Firefox Telemetry at all, you'll use Glean via Firefox on Glean (FOG) and it'll Just Work(tm). (If you'd like some details as to how this works: we determine which metrics definitions files are present in which application using a dependency tree. Your metrics file would be listed in the metrics_files definition for a new library named gecko or something, which will be a dependency of both engine-gecko (destined for Fenix) and firefox-desktop.) (If you'd like some details about why this doesn't already work, it's because Fenix already has its own Glean and it is in conflict with the Glean inside Gecko. Resolving this for Glean and other Rust Shared Libraries that hope to follow the same pattern (application-services, nimbus, etc) has been an area of focused effort for some months.).

If it's important that your Glean metrics also be mirrored to Telemetry for a period of time for analysis/reporting reasons, we have something that does that.

If fennec shouldn't be used, why is it still used? Does it do anything or is it just dead code?

It is still used because it hasn't been removed. Telemetry's defennecstration was scheduled for September of 2019 but other work took priority. Plus, at the time certain probes were being added to ESR to reach the remaining Fennec population, so we were in no hurry to make those merges more difficult.

And then 2020 : |

Is it dead? Short answer: Mostly Yes. Longer answer: Right now it flips a 0 to a 1 in a uint8_t flag value we use to determine if we should prevent a Telemetry probe from being recorded. This should matter not a single whit in normal builds.

(In reply to Rob Wu [:robwu] from comment #3)

And "thunderbird" is also listed in Scalars.yaml but not documented in scalars.rst.

That's an oversight. We should've documented that as part of the work to add Thunderbird Telemetry support. I have filed bug 1713122 to track the work of fixing that. Thanks for the report!

Thanks for the detailed reply. It would be nice to add it to the docs, or link to this bug from it ;)

Earlier today I tried to add "fennec" to Scalars.yaml and Events.yaml re-enable disabled tests on Android (test_blocklist_telemetry.js, test_blocklist_mlbf_telemetry.js, test_blocklist_statechange_telemetry.js), but gave up because I was not able to detect telemetry there (and I didn't have to re-enable those tests, they were nice-to-haves).
I ultimately printed the value of TelemetryTestUtils.getProcessScalars("parent"); (source code in test), but it had only three scalars that were unrelated to what I was testing. Apparently I had to use geckoview_streaming and it should have worked? Or is there no point in trying since "events aren't supported"?

The current documentation is GeckoView-centric. While that's fine for GV-only tests, I am interested in how one can develop one (xpcshell) tests that verifies the behavior across platforms (desktop and Android). Is it possible to run the three tests referenced above with minimal modifications?

(In reply to Rob Wu [:robwu] from comment #5)

The current documentation is GeckoView-centric. While that's fine for GV-only tests, I am interested in how one can develop one (xpcshell) tests that verifies the behavior across platforms (desktop and Android). Is it possible to run the three tests referenced above with minimal modifications?

Y'know, I think we might have a solution for that. I'd forgotten it existed until you had me go looking, but we have toolkit.telemetry.testing.overrideProductsCheck which is a test-only pref that should bypass the products check, allowing your probes (including events) to be recorded regardless of the fact that they don't (and can't) support the product xpcshell is pretending to be on Android.

(( Naturally, once we land GV support in FOG and can remove the MOZ_GLEAN_ANDROID #ifdefs this'll be straightforward for Glean collections. But Glean's testing situation is much better than Telemetry's (and will be even better), so this isn't a surprise. Nor is it necessarily helpful to your specific query, but is useful information for me to convey since the Glean future is a-comin'. ))

Not likely that we'll get to this before we remove all the related code, but it's possible.

Severity: -- → S4
Priority: -- → P4
See Also: → 1820155
You need to log in before you can comment on or make changes to this bug.