Closed Bug 1807898 Opened 2 years ago Closed 2 years ago

Simplify telemetry's sessionID implementation

Categories

(DevTools :: Framework, task)

task

Tracking

(firefox110 fixed)

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

First, the sessionID is currently computed from ToolboxHostManager... but this could be done by the Toolbox as it also instantiate a Telemetry instance.

Second, ToolboxHostManager currently set the sessionID on the <iframe> element of the toolbox, that solely for the debugger frontend codebase.
But this practice will no longer work once the toolbox runs in a privileged process. It will no longer have access to its frame element.
https://searchfox.org/mozilla-central/rev/8fd39dc89c68501a354446a8681ec8263d15e5aa/devtools/client/framework/toolbox-host-manager.js#128
https://searchfox.org/mozilla-central/rev/8fd39dc89c68501a354446a8681ec8263d15e5aa/devtools/client/debugger/src/utils/telemetry.js#63

This pattern would no longer work when running the toolbox in a distinct process.
We will no longer have access to the frame element from the toolbox process.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

This slightly simplifies the Toolbox instantiation.
The long term goal being to make the Toolbox object being self-instantiated by the toolbox document.

Actually... we can simplify things even more by having Telemetry class to self-compute its sessionId.
This would help remove all callsites having to manually pass a sessionId to Telemetry.recordEvent.

Attachment #9310194 - Attachment is obsolete: true

This was slightly more tricky in the debugger as the toolbox's telemetry should be provided to the telemetry module.

This will help simplify all callsites manually setting this attribute.
I inlined simplification of all toolOpened/toolClosed in this changeset,
but all usages of recordEvent will be simplified in the next changeset.

Toolbox.sessionId is now only used by console performance markers in
order to help differentiate toolbox instances.

Note that about:debugging was also using a dedicated sessionId.

Note that there is still one leftover usage of sessionId related to performance markers,
which isn't related to telemetry... but a way to distinguish toolbox instances.

Attachment #9310195 - Attachment description: Bug 1807898 - [devtools] Make the toolbox self-compute its telemetry's sessionID. → Bug 1807898 - [devtools] Stop passing a sessionID to Toolbox.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/96237fdcf3ee [devtools] Reuse toolbox's Telemetry instance from all panels. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/a1d814570066 [devtools] Set Telemetry sessionID by the Telemetry helper. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/e3a480585153 [devtools] Remove all callsites passing a now-useless telemetry sessionId. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/0c989b2bcd78 [devtools] Stop passing a sessionID to Toolbox. r=devtools-reviewers,nchevobbe
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: