There are different APIs and formats to collect data in Firefox, all suiting different use cases.
In general, we aim to submit data in a common format where possible. This has several advantages; from common code and tooling to sharing analysis know-how.
In cases where this isn’t possible and more flexibility is needed, we can submit custom pings or consider adding different data formats to existing pings.
Note: Every new data collection must go through a data collection review.
The current data collection possibilities include:
- Scalars allow recording of a single value (string, boolean, a number)
- Histograms can efficiently record multiple data points
environmentdata records information about the system and settings a session occurs in
- Events can record richer data on individual occurences of specific actions
TelemetryLogallows collecting ordered event entries (note: this does not have supporting analysis tools)
- measuring elapsed time
- custom pings
- stack capture allow recording application call stacks
- Use counters measure the usage of web platform features
Experiment annotations can be added through the API exposed in
TelemetryEnvironment.jsm and are collected in the environment:
TelemetryEnvironment.setExperimentActive(id, branch), adds an annotation to the environment for the provided
branch. This triggers a new subsession.
TelemetryEnvironment.setExperimentInactive(id), removes the annotation for the experiment with the provided
id. This triggers a new subsession.
TelemetryEnvironment.getActiveExperiments(), returns a dictionary containing the informations for each active experiment.