Glean is a modern approach for recording and sending Telemetry data.
It’s in use at Mozilla.
All documentation can be found online:
The different metric types supported by the Glean SDK to handle data.
Ping collection, assembly & submission.
API definitions for the different metric types supported by the Glean SDK.
Manages the pending pings queue and directory.
A boolean metric.
Metrics included in every ping as
The common set of data shared across all different metric types.
A counter metric.
A custom distribution metric.
Representation of a date, time and timezone.
A datetime metric.
A Denominator metric (a kind of count shared among Rate metrics).
An event metric.
The object holding meta information about a Glean instance.
Configuration for Glean
A labeled metric.
A memory distribution metric.
Developer-facing API for recording rate metrics with external denominators.
How to specify the rate at which pings may be uploaded before they are throttled.
Represents a request to upload a ping.
Stores information about a ping.
A quantity metric.
A rate value as given by its numerator and denominator.
A rate metric.
Represents the recorded data for a single event.
Deserialized experiment data.
A string list metric.
A string metric.
A text metric.
Identifier for a running timer.
A timespan metric.
A timing distribution metric.
A URL metric.
An UUID metric.
An error returned from callbacks.
A list enumerating the categories of errors in this crate.
The possible error types for metric recording. Note: the cases in this enum must be kept in sync with the ones in the platform-specific code (e.g.
ErrorType.kt) and with the
metrics in the registry files.
Different kinds of histograms.
The supported metrics’ lifetimes.
Different resolutions supported by the memory related metric types (e.g. MemoryDistributionMetric).
Different resolutions supported by the time related metric types (e.g. DatetimeMetric).
The result of an attempted ping upload.
Communication back whether the uploader loop should continue.
Trait for metrics that can be nested inside a labeled metric.
A callback handler that receives the base identifier of recorded events The identifier is in the format:
A callback object used to trigger actions on the foreign-language side.
Returns a timestamp corresponding to “now” with millisecond precision.
Initialize the logging system based on the target platform. This ensures that logging is shown when executing the Glean SDK unit tests.
Initialize the logging system to send JSON messages to a file descriptor (Unix) or file handle (Windows).
Get the next upload task
Performs the collection/cleanup operations required by becoming active.
Performs the collection/cleanup operations required by becoming inactive.
Creates and initializes a new Glean object for use in a subprocess.
Processes the response from an attempt to upload a ping.
EXPERIMENTAL: Register a listener object to recieve notifications of event recordings.
Sets a debug view tag.
Indicate that an experiment is running. Glean will then add an experiment annotation to the environment which is sent with pings. This infomration is not persisted between runs.
Indicate that an experiment is no longer running.
Set an experimentation identifier dynamically.
Sets the log pings debug option.
Sets a remote configuration to override metrics’ default enabled/disabled state
Sets source tags.
Sets whether upload is enabled or not.
Shuts down Glean in an orderly fashion.
Collect and submit a ping for eventual upload by name.
Collect and submit a ping (by its name) for eventual upload, synchronously.
TEST ONLY FUNCTION. Returns the
RecordedExperiment for the given
None if the id isn’t found.
TEST ONLY FUNCTION. Gets stored experimentation id annotation.
Unregister an event listener from recieving notifications.
TEST ONLY FUNCTION Waits on all the glean.init threads’ join handles.
Asks the database to persist ping-lifetime data to disk. Probably expensive to call. Only has effect when Glean is configured with
If Glean hasn’t been initialized this will dispatch and return Ok(()),
otherwise it will block until the persist is done and return its Result.
Shuts down Glean in an orderly fashion.
Gets the number of recorded errors for the given metric and error type.