Closed Bug 1513616 Opened 6 years ago Closed 5 years ago

Clear metrics when telemetry is disabled

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Dexter, Assigned: mdroettboom)

References

Details

(Whiteboard: [telemetry:mobilesdk:m8])

Attachments

(2 files)

Products might need to implement a "refresh" function that clears the user profile. Or, some products might want to clear all the data once telemetry is turned off. To enable these use cases, we need APIs to clear the client id and, in general, all the metrics with user lifetime.
Blocks: 1491345
Priority: -- → P3
Whiteboard: [telemetry:mobilesdk:m?]
Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:m7]
Assignee: nobody → tlong
Priority: P3 → P1
Assignee: tlong → nobody
Priority: P1 → P3
Assignee: nobody → mdroettboom
Attached file GitHub Pull Request (deleted) —

:Dexter added in a comment in the PR that maybe what we really should be doing is removing all pending metrics and pings when telemetry is disabled (see this comment).

Flags: needinfo?(gfritzsche)

I would propose we hang this off one specific use-case.

From what i see in comment 0, the important one that is needed for Fenix is probably:
"A Fenix user opted out of sending Telemetry."

The expectation on Desktop is, that on disabling Telemetry (code):

  • That we set the client id to a known value.
  • That we discard all pending pings.
  • We stop all uploading of pings.
  • That we reset all metrics (Desktop only resets some actually?).
    • Some exceptions might apply for Glean, like not resetting say install date?
  • That we send a last optout ping, which contains no client id (follow-up bug to discuss this is required here?).

On re-enabling Telemetry, we:

  • Set the client id to a new UUID (this i think is a policy requirement).
  • Start freshly recording metrics again (implementation dependent: either reset one more time or stop discarding recorded values).
Flags: needinfo?(gfritzsche)

Chenxia, is this the right use-case / requirement for Fenix?

Do the Desktop actions as listed here apply to mobile & Fenix as well?

Flags: needinfo?(liuche)

This would seem like a reasonable approach to me for Mobile in general:

  1. if a user opts out, delete all pending telemetry pings
  2. stop uploading
  3. When you say "resetting all metrics" - does that also mean we stop updating them locally (like histograms)? That also seems to make sense to me.

2 seems absolutely necessary, 1 and 3 are things that definitely make sense and that I'd certainly prefer.

Keeping the install date also makes sense.

In terms of "Fenix requirements", let's aim for consistency across all our Mobile products. Also, I don't think there are any explicit requirements, but let me check with the Metrics team to see if there are any additional side effects they'd want to call out.

So overall this seems like a good approach.

Flags: needinfo?(liuche)

Frank, do you have any thoughts on this, from a data analysis perspective? Do you handle clients who have turned off telemetry, and then turn it back on differently, or would this cause any glaring problems?

Flags: needinfo?(fbertsch)

I don't see this causing any serious issues. Some clients do switch between them, but it's rare enough that it doesn't cause analysis issues.

Flags: needinfo?(fbertsch)
Whiteboard: [telemetry:mobilesdk:m7] → [telemetry:mobilesdk:m8]
Summary: Provide an API to clear user-lifetime metrics → Clear metrics when telemetry is disabled
Attached file GitHub Pull Request (deleted) —
Component: Telemetry → Glean: SDK
Product: Toolkit → Data Platform and Tools
Version: Trunk → unspecified
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: