Expand description
Glean is a modern approach for recording and sending Telemetry data.
It’s in use at Mozilla.
All documentation can be found online:
§The Glean SDK Book
Re-exports§
- pub use crate::metrics::BooleanMetric;
- pub use crate::metrics::CounterMetric;
- pub use crate::metrics::CustomDistributionMetric;
- pub use crate::metrics::Datetime;
- pub use crate::metrics::DatetimeMetric;
- pub use crate::metrics::DenominatorMetric;
- pub use crate::metrics::DistributionData;
- pub use crate::metrics::EventMetric;
- pub use crate::metrics::LocalCustomDistribution;
- pub use crate::metrics::LocalMemoryDistribution;
- pub use crate::metrics::LocalTimingDistribution;
- pub use crate::metrics::MemoryDistributionMetric;
- pub use crate::metrics::MemoryUnit;
- pub use crate::metrics::NumeratorMetric;
- pub use crate::metrics::ObjectMetric;
- pub use crate::metrics::PingType;
- pub use crate::metrics::QuantityMetric;
- pub use crate::metrics::Rate;
- pub use crate::metrics::RateMetric;
- pub use crate::metrics::RecordedEvent;
- pub use crate::metrics::RecordedExperiment;
- pub use crate::metrics::StringListMetric;
- pub use crate::metrics::StringMetric;
- pub use crate::metrics::TextMetric;
- pub use crate::metrics::TimeUnit;
- pub use crate::metrics::TimerId;
- pub use crate::metrics::TimespanMetric;
- pub use crate::metrics::TimingDistributionMetric;
- pub use crate::metrics::UrlMetric;
- pub use crate::metrics::UuidMetric;
- pub use crate::upload::PingRequest;
- pub use crate::upload::PingUploadTask;
- pub use crate::upload::UploadResult;
- pub use crate::upload::UploadTaskAction;
Modules§
- metrics
- The different metric types supported by the Glean SDK to handle data.
- ping
- Ping collection, assembly & submission.
- storage
- Storage snapshotting.
- traits
- API definitions for the different metric types supported by the Glean SDK.
- upload
- Manages the pending pings queue and directory.
Structs§
- ClientInfo Metrics 
- Metrics included in every ping as client_info.
- CommonMetric Data 
- The common set of data shared across all different metric types.
- Error
- A specialized Errortype for this crate’s operations.
- Glean
- The object holding meta information about a Glean instance.
- InternalConfiguration 
- Configuration for Glean
- LabeledMetric 
- A labeled metric.
- PingRate Limit 
- How to specify the rate at which pings may be uploaded before they are throttled.
- UniFfiTrait Vtable Glean Event Listener 
- UniFfiTrait Vtable OnGlean Events 
Enums§
- CallbackError 
- An error returned from callbacks.
- ErrorKind 
- A list enumerating the categories of errors in this crate.
- ErrorType 
- The possible error types for metric recording.
- HistogramType 
- Different kinds of histograms.
- LabeledMetric Data 
- The metric data needed to construct inner submetrics.
- Lifetime
- The supported metrics’ lifetimes.
Traits§
- AllowLabeled 
- Trait for metrics that can be nested inside a labeled metric.
- GleanEvent Listener 
- A callback handler that receives the base identifier of recorded events
The identifier is in the format: <category>.<name>
- OnGleanEvents 
- A callback object used to trigger actions on the foreign-language side.
Functions§
- get_timestamp_ ms 
- Returns a timestamp corresponding to “now” with millisecond precision.
- glean_apply_ server_ knobs_ config 
- Sets a remote configuration to override metrics’ default enabled/disabled state
- glean_enable_ logging 
- Initialize the logging system based on the target platform. This ensures that logging is shown when executing the Glean SDK unit tests.
- glean_enable_ logging_ to_ fd 
- Initialize the logging system to send JSON messages to a file descriptor (Unix) or file handle (Windows).
- glean_get_ debug_ view_ tag 
- Gets the currently set debug view tag.
- glean_get_ log_ pings 
- Gets the current log pings value.
- glean_get_ registered_ ping_ names 
- Gets a list of currently registered ping names.
- glean_get_ upload_ task 
- Get the next upload task
- glean_handle_ client_ active 
- Performs the collection/cleanup operations required by becoming active.
- glean_handle_ client_ inactive 
- Performs the collection/cleanup operations required by becoming inactive.
- glean_initialize 
- Initializes Glean.
- glean_initialize_ for_ subprocess 
- Creates and initializes a new Glean object for use in a subprocess.
- glean_persist_ ping_ lifetime_ data 
- Asks the database to persist ping-lifetime data to disk.
- glean_process_ ping_ upload_ response 
- Processes the response from an attempt to upload a ping.
- glean_register_ event_ listener 
- EXPERIMENTAL: Register a listener object to recieve notifications of event recordings.
- glean_set_ collection_ enabled 
- Sets whether collection is enabled or not.
- glean_set_ debug_ view_ tag 
- Sets a debug view tag.
- glean_set_ dirty_ flag 
- TEST-ONLY Method
- glean_set_ experiment_ active 
- 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.
- glean_set_ experiment_ inactive 
- Indicate that an experiment is no longer running.
- glean_set_ experimentation_ id 
- Set an experimentation identifier dynamically.
- glean_set_ log_ pings 
- Sets the log pings debug option.
- glean_set_ source_ tags 
- Sets source tags.
- glean_set_ test_ mode 
- TEST-ONLY Method
- glean_set_ upload_ enabled 
- DEPRECATED Sets whether upload is enabled or not.
- glean_shutdown 
- Shuts down Glean in an orderly fashion.
- glean_submit_ ping_ by_ name 
- Collect and submit a ping for eventual upload by name.
- glean_submit_ ping_ by_ name_ sync 
- Collect and submit a ping (by its name) for eventual upload, synchronously.
- glean_test_ destroy_ glean 
- TEST-ONLY Method
- glean_test_ get_ experiment_ data 
- TEST ONLY FUNCTION.
Returns the RecordedExperimentfor the givenexperiment_idorNoneif the id isn’t found.
- glean_test_ get_ experimentation_ id 
- TEST ONLY FUNCTION. Gets stored experimentation id annotation.
- glean_unregister_ event_ listener 
- Unregister an event listener from recieving notifications.
- join_init 
- TEST ONLY FUNCTION Waits on all the glean.init threads’ join handles.
- set_ping_ enabled 
- Enable or disable a ping.
- shutdown
- Shuts down Glean in an orderly fashion.
- test_get_ num_ recorded_ errors 
- Gets the number of recorded errors for the given metric and error type.
- uniffi_glean_ core_ fn_ init_ callback_ vtable_ gleaneventlistener 
- uniffi_glean_ core_ fn_ init_ callback_ vtable_ ongleanevents 
Type Aliases§
- LabeledBoolean 
- A labeled boolean.
- LabeledCounter 
- A labeled counter.
- LabeledCustom Distribution 
- A labeled custom_distribution.
- LabeledMemory Distribution 
- A labeled memory_distribution.
- LabeledQuantity 
- A labeled quantity
- LabeledString 
- A labeled string.
- LabeledTiming Distribution 
- A labeled timing_distribution.
- Result
- A specialized Resulttype for this crate’s operations.