Closed Bug 1356223 Opened 5 years ago Closed 5 years ago

Support scalar telemetry probe types in Telemetry.js


(DevTools :: General, enhancement, P2)



(firefox55 fixed)

Firefox 55
Tracking Status
firefox55 --- fixed


(Reporter: pbro, Assigned: miker)



(Whiteboard: [todo-mr])


(1 file)

I recently tried to add 3 new "count" probes to Histograms.json and got backed out because probes "kind": "count" aren't allowed anymore for Firefox Desktop!

See bug 1352115 for context.

Here's the failure:
And the error message from there:

New "count" histograms are not supported on Desktop, you should use scalars instead:

So, going forward we need to use "uint" probes for these things, but we have a custom wrapper class for telemetry in DevTools, and this wrapper won't work with these new types, because the JS API to set values is different.

So, this bug is about changing Telemetry.js to support scalar types.

Note that in this bug, we should also update the documentation in to mention that count kind isn't supported anymore on Desktop.
We should use Services.telemetry.scalarSet(histId, true); inside of Telemetry.js
Assignee: nobody → mratcliffe
Priority: -- → P2
Comment on attachment 8859562 [details]
Bug 1356223 - Support scalar telemetry probe types in Telemetry.js

::: devtools/client/shared/telemetry.js:286
(Diff revision 1)
> +   *         Scalar in which the data is to be stored.
> +   * @param  value
> +   *         Value to store.
> +   */
> +  logScalar: function (scalarId, value) {
> +    if (scalarId) {

nit: Maybe invert this condition to make the function easier to read:

if (!scalarId) {

try {

::: devtools/client/shared/telemetry.js:298
(Diff revision 1)
> +          return;
> +        }
> +        Services.telemetry.scalarSet(scalarId, value);
> +      } catch (e) {
> +        dump(`Warning: An attempt was made to write to the ${scalarId} ` +
> +             `histogram, which is not defined in Scalars.yaml\n`);

Attachment #8859562 - Flags: review?(pbrosset) → review+
Pushed by
Support scalar telemetry probe types in Telemetry.js r=pbro
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.