Simplify telemetry's sessionID implementation
Categories
(DevTools :: Framework, task)
Tracking
(firefox110 fixed)
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
Assignee | ||
Comment 1•2 years ago
|
||
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.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This slightly simplifies the Toolbox instantiation.
The long term goal being to make the Toolbox object being self-instantiated by the toolbox document.
Assignee | ||
Comment 3•2 years ago
|
||
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.
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
This was slightly more tricky in the debugger as the toolbox's telemetry should be provided to the telemetry module.
Assignee | ||
Comment 5•2 years ago
|
||
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.
Assignee | ||
Comment 6•2 years ago
|
||
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.
Updated•2 years ago
|
Comment 8•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/96237fdcf3ee
https://hg.mozilla.org/mozilla-central/rev/a1d814570066
https://hg.mozilla.org/mozilla-central/rev/e3a480585153
https://hg.mozilla.org/mozilla-central/rev/0c989b2bcd78
Description
•