Updating registered telemetry events in an add-on during a single Firefox session

Jim Porter jporter at mozilla.com
Fri Oct 13 20:37:27 UTC 2017


I'm one of the developers on Lockbox[1], an embedded WebExtension that 
uses XPCOM to handle telemetry. I've run into an issue where updating 
our add-on makes the telemetry API unhappy because we're re-registering 
events with the same category name. I'd like to re-run 
`nsITelemetry.registerEvents` in case we've added something to our 
telemetry. Is there a way to unregister events during the add-on's 
shutdown? (Currently, we're running `registerEvents` in our 
bootstrap.js's `startup` function[2].)

I have a workaround in progress that appends a version to our main 
category name (in this case "lockboxv0") so that we can just increment 
the version anytime we change the events we want to record. Is there a 
better way?

- Jim

[1] https://github.com/mozilla-lockbox/lockbox-extension
[2] 
https://github.com/jimporter/lockbox-extension/blob/master/src/bootstrap.js#L12-L22


More information about the Fx-data-dev mailing list