Skip to content

Conversation

@gcp
Copy link
Contributor

@gcp gcp commented Nov 23, 2025

No description provided.

gcp and others added 30 commits November 22, 2025 21:40
…metry sending

Changes sendingEnabled() to check AppConstants.MOZ_TELEMETRY_REPORTING instead of
Services.telemetry.isOfficialTelemetry. This aligns with the conceptual separation
of MOZILLA_OFFICIAL (official Mozilla build) from MOZ_TELEMETRY_REPORTING (telemetry
transmission enabled), allowing for more granular control over telemetry behavior.

Fixes the issue where "upload is turned off" was incorrectly shown in builds with
MOZ_TELEMETRY_REPORTING enabled but MOZILLA_OFFICIAL disabled.
…NG config

- Reset telemetry.fog.test.localhost_port to 0 (default)
- Use MOZ_TELEMETRY_REPORTING instead of MOZILLA_OFFICIAL for glean upload control
- Expose MOZ_TELEMETRY_REPORTING as config variable for build system access
- Create new enterprise ping definition in browser/components/downloads/pings.yaml
- Move both file_downloaded and security_download_completed events to enterprise ping
- Consolidate all download telemetry events in browser component metrics.yaml
- Register enterprise ping in glean metrics_index.py for Firefox Desktop
- Add GleanPings.enterprise.submit() calls to actually send the ping
- Remove duplicate telemetry event definitions from toolkit component

This separates enterprise security telemetry from the general events ping,
providing better data organization and privacy controls.
PathUtils is available as a WebIDL global binding in Firefox, not as an ES module.
Removed the ChromeUtils.importESModule call and fallback code since PathUtils
is always available in this context.
_isEnabled() {
return Services.prefs.getBoolPref(
"browser.download.enterprise.telemetry.enabled",
true
Copy link
Contributor

Choose a reason for hiding this comment

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

we default to enabled by default? ok

Copy link
Contributor Author

@gcp gcp Nov 24, 2025

Choose a reason for hiding this comment

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

Mostly for debugging, can flip the default later on. We did enable the other stuff by default.

CrowdStrike knows your downloads anyway :P

telemetry_mirror: DOWNLOADS_PANEL_SHOWN

#ifdef MOZ_ENTERPRISE
download_completed:
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need feedback from glean people on how we do this? not data review but making sure event is the correct way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already had this discussions about this part. An event works, but it's only live if it's not part of the normal (Firefox) events ping, which is why this needed a separate enterprise ping. Normal Firefox events are queued up to 500 and sent together. We don't want this for Enterprise to make the console a "live" view.

# Only run in MOZ_ENTERPRISE builds
skip-if = [
"!buildapp:firefox",
"!enterprise",
Copy link
Contributor

Choose a reason for hiding this comment

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

we have this mozinfo flag? good to know I'll use it for policies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should probably test the non-enterprise build :P

},

BlocklistDomainBrowsedTelemetry: {
onBeforeAddons(manager, param) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: onRemove could be welcome :)

},

PrintPageTelemetry: {
onBeforeAddons(manager, param) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: onRemove would be welcome

},

DownloadTelemetry: {
onBeforeAddons(manager, param) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: onRemove would be welcome

"browser.newtabpage.activity-stream.feeds.system.topstories=true",
"browser.newtabpage.activity-stream.feeds.section.topstories=true",
"browser.newtabpage.activity-stream.feeds.system.topstories=true",
"browser.newtabpage.activity-stream.telemetry.structuredIngestion=false",
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we remove?

Copy link
Contributor

Choose a reason for hiding this comment

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

i would feel safer if we did this removal conditionnally on being an enterprise build

// We only send pings when telemetry reporting is enabled, but allow overriding this for tests.
if (
!Services.telemetry.isOfficialTelemetry &&
!AppConstants.MOZ_TELEMETRY_REPORTING &&
Copy link
Contributor

Choose a reason for hiding this comment

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

might be worth scoping this only to enterprise builds?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe at some point we'll have our own distinction of official / non official builds?

#ifdef MOZ_ENTERPRISE
send_in_pings:
- enterprise
- default
Copy link
Contributor

Choose a reason for hiding this comment

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

why default ? isn't it always sent to in the default ping?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope the other events aren't :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants