Closed Bug 2065488 Opened 3 months ago Closed 1 month ago

Add telemetry for the weekly privacy report notification worker

Categories

(Firefox for Android :: Experimentation and Telemetry, task)

All
Android
task
Points:
5

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: towhite, Assigned: Gela)

References

(Blocks 1 open bug)

Details

(Whiteboard: [android-activation-trust] [fxdroid])

Attachments

(3 external files, 2 obsolete files)

Summary

Add telemetry for the weekly privacy report notification to understand the full lifecycle of the feature, including:

  • whether the background worker runs as expected,
  • whether a notification is shown, clicked, or dismissed,
  • whether the notification channel or app-level notifications have been disabled,

The telemetry should provide enough information to distinguish between a notification that was never attempted, one that was blocked by notification settings, and one that was successfully delivered but not interacted with.

Background

PrivacyReportNotificationWorker currently has no telemetry.

Recording only shown, clicked, and dismissed events would leave important gaps in understanding the feature's behaviour in the wild. In particular, states that prevent a notification from being shown would otherwise be invisible. For example:

  • the worker was not scheduled,
  • the worker was scheduled but did not run,
  • the worker ran but did not show a notification,
  • the notification channel was disabled,
  • app-level notifications were disabled, or
  • the worker ran outside the expected weekly cadence.

The goal is therefore to instrument the full lifecycle of the feature rather than only notification interactions. Analysis should be able to determine whether the worker is operating as expected and, when a notification is not delivered, identify where in the lifecycle it stopped.

Because this functionality runs in the background, telemetry should not rely solely on the standard events ping eventually being flushed. We should also have a durable mechanism for reporting the worker's state.

Possible tasks

  • [ ] Worker execution

    • Record an event whenever PrivacyReportNotificationWorker runs, regardless of whether a notification is ultimately shown.
  • [ ] Notification interaction

    • Record shown, clicked, and dismissed telemetry for the notification.
  • [ ] Notification availability

    • Capture when the feature's notification channel is disabled.
    • Capture when app-level notifications are disabled.
    • Distinguish between channel-level and app-level notification opt-out.
  • [ ] Worker state

    • Record whether the worker is currently scheduled.
    • Maintain a counter for the number of times the worker has run.
  • [ ] Delivery cadence

    • Record the timestamp at which the notification schedule was first established.
    • Associate worker executions/notifications with a weekly sequence number. (A nice to have)
    • Provide enough information to determine whether expected weekly executions occurred and identify missed or delayed runs.
  • [ ] Durable reporting

    • Add a custom Glean ping for the privacy report notification worker, following the existing pings.yaml pattern.
    • Include the relevant events and roll-up/state metrics in the ping.
    • Submit the ping explicitly at appropriate points where we control scheduling/state changes, rather than relying solely on the standard events ping being flushed.

Analysis requirements

The resulting telemetry should allow us to reconstruct, as far as possible, the lifecycle for a given installation:

scheduled → worker ran → notification shown → clicked/dismissed

It should also allow us to identify where that lifecycle stopped, including cases where the worker was unscheduled or notifications were disabled.

This should make it possible to answer questions such as:

  • Was the worker scheduled?
  • Did it run when expected?
  • How many times has it run?
  • Was a notification shown for a given run?
  • Was the notification clicked or dismissed?
  • Were notifications unavailable because the channel was disabled?
  • Were notifications unavailable because app-level notifications were disabled?
  • Are notifications being delivered at approximately the intended weekly cadence?

Previous work

An earlier version of the shown / clicked / dismissed telemetry, using a BroadcastReceiver, was drafted as part of bug 2060524 before being removed from the stack.

See:

No longer blocks: 2060524
Depends on: 2060524
Type: enhancement → task
Points: --- → 5
Assignee: nobody → gmalekpour
Status: NEW → ASSIGNED
Attachment #9631842 - Attachment description: WIP: Bug 2065488 - Part 1: record event whenever PrivacyReportNotificationWorker runs → WIP: Bug 2065488 - Part 1: record event whenever PrivacyReportNotificationWorker schedules or runs
Attachment #9631842 - Attachment description: WIP: Bug 2065488 - Part 1: record event whenever PrivacyReportNotificationWorker schedules or runs → WIP: Bug 2065488 - record telemetry for notification privacy feature
Attachment #9632168 - Attachment is obsolete: true
Attachment #9631842 - Attachment is obsolete: true
Attachment #9636824 - Attachment description: WIP: Bug 2065488 - Part 1: Record telemetry when privacy notification report is shown or dismissed → Bug 2065488 - Part 1: Record telemetry when privacy notification report is shown or dismissed
Attachment #9636840 - Attachment description: WIP: Bug 2065488 - Part 2: Record telemetry when the notification channel or app-level notifications have been disabled → Bug 2065488 - Part 2: Record telemetry when the notification channel or app-level notifications have been disabled
Attachment #9636851 - Attachment description: WIP: Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker → Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker
Attachment #9636851 - Attachment description: Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker → WIP: Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker
Pushed by gmalekpour@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7fcf0e3db28b https://hg.mozilla.org/integration/autoland/rev/fa7d7058a5fd Part 1: Record telemetry when privacy notification report is shown or dismissed r=android-reviewers,twhite https://github.com/mozilla-firefox/firefox/commit/d8fb8aea942a https://hg.mozilla.org/integration/autoland/rev/fc3943688575 Part 2: Record telemetry when the notification channel or app-level notifications have been disabled r=android-reviewers,twhite
Blocks: 2075375
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
Attachment #9636851 - Attachment description: WIP: Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker → Bug 2065488 - Part 3: Record telemetry for the lifecycle of the privacy notification worker
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Keywords: leave-open
Pushed by gmalekpour@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/355d8178d892 https://hg.mozilla.org/integration/autoland/rev/8f1848bd8fd6 Part 3: Record telemetry for the lifecycle of the privacy notification worker r=android-reviewers,nalexander
Status: REOPENED → RESOLVED
Closed: 2 months ago → 1 month ago
Resolution: --- → FIXED
Blocks: 2089628
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: