Closed Bug 1863031 Opened 1 year ago Closed 25 days ago

Migrate legacy events to glean

Categories

(Toolkit :: Telemetry, task)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: Dexter, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 obsolete file)

After talking to Nick Alexander, we decided it might be wise to file a bug to start thinking about ways we could automatically migrate legacy events to glean events.

This bug is exclusively for figuring out how can things be automatically migrated.

On a quick look, it sees like it might be possible to generate a glean identifier (and its related definition for the metrics YAML) by joining the legacy category, name, method and object for those events that only have one method or object. For example this:

creditcard:
  manage:
    description: >-
      User interactions for credit card autofill preferences management UI.
    objects:
      - "manage"
    methods:
      - "show"
      - "add"
      - "delete"
      - "show_entry"
      - "edit"

could become something like this (generalized event):

creditcard:
  manage:
    type: event
    description: |
      User interactions for credit card autofill preferences management UI.
    bugs:
      - https://bugzilla.mozilla.org/000000
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=000000#c3
    notification_emails:
      - me@mozilla.com
    expires: 2020-10-01
    extra_keys:
      element:
        description: The source from which the login view was opened, e.g. "toolbar".
        type: string

or this (specialized events)

creditcard.manage:
  show:
    type: event
    description: |
      User interactions for credit card autofill preferences management UI
    bugs:
      - https://bugzilla.mozilla.org/000000
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=000000#c3
    notification_emails:
      - me@mozilla.com
    expires: 2020-10-01

creditcard.manage:
  add:
    type: event
    description: |
      User interactions for credit card autofill preferences management UI
    bugs:
      - https://bugzilla.mozilla.org/000000
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=000000#c3
    notification_emails:
      - me@mozilla.com
    expires: 2020-10-01

This gets into the "generalized" vs "specialized" events topic that is currently being discussed at data-leads level, but we don't need to make any decision on this as part of this bug.

Nick, does this capture what we talked about?

Flags: needinfo?(nalexander)

Nick, does this capture what we talked about?

Yes, just so. When looking at the list of legacy events, I recall that there were a few different patterns. Using:

import yaml
events = yaml.safe_load(open('toolkit/components/telemetry/Events.yaml'))

simple = []
both = []

for category, names in events.items():
    for name, event in names.items():
        num_methods = len(event.get('methods', []))
        num_objects = len(event.get('objects', []))

        l = simple
        if num_methods > 1 and num_objects > 1:
            l = both
        l.append((category, name, event))

print(f"#simple:  {len(simple)}")
print(f"#complex: {len(both)}")

for c, n, _ in both:
    print(c, n)

I see

#simple:  206
#complex: 8
addonsManager install
addonsManager manage
address doorhanger
creditcard doorhanger
pwmgr mgmt_interaction
relay_integration popup_option
telemetry.test test
intl.ui.browserLanguage action

Looking more closely at those, it really looks like the objects should be an extra and the methods are the events. This suggests that we could cover all of the existing events automatically. \o/

Flags: needinfo?(nalexander)
Depends on: 1887891
Depends on: 1888703
Depends on: 1894523
Depends on: 1896732
Depends on: 1910122
Depends on: 1910976
Depends on: 1918226

Comment on attachment 9423587 [details]
WIP: Bug 1863031 - Document deprecation and removal of Services.telemetry.recordEvent and registerEvents r?TravisLong!

Revision D221502 was moved to bug 1918226. Setting attachment 9423587 [details] to obsolete.

Attachment #9423587 - Attachment is obsolete: true
Depends on: 1918702
Depends on: 1920073
See Also: → 1920562
Depends on: 1921790
See Also: → 1923028

Migration of callers has been completed, the APIs have been removed, a note has been sent to firefox-dev and dev-platform. Time to close this bug!

Status: NEW → RESOLVED
Closed: 25 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: