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
§Example
Initialize Glean, register a ping and then send it.
let cfg = Configuration {
data_path: "/tmp/data".into(),
application_id: "org.mozilla.glean_core.example".into(),
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: None,
};
glean_preview::initialize(cfg, ClientInfoMetrics::unknown())?;
let prototype_ping = PingType::new("prototype", true, true);
glean_preview::register_ping_type(&prototype_ping);
prototype_ping.submit();
Modules§
- metrics
- The different metric types supported by the Glean SDK to handle data.
Structs§
- Client
Info Metrics - Metrics included in every ping as
client_info
. - Common
Metric Data - The common set of data shared across all different metric types.
- Configuration
- The Glean configuration.
- Error
- A specialized
Error
type for this crate’s operations. - Glean
- The object holding meta information about a Glean instance.
Enums§
- Lifetime
- The supported metrics’ lifetimes.
Functions§
- initialize
- Create and initialize a new Glean object.
- is_
upload_ enabled - Determine whether upload is enabled.
- register_
ping_ type - Register a new
PingType
. - set_
upload_ enabled - Set whether upload is enabled or not.
- submit_
ping - Collect and submit a ping for eventual uploading.
- submit_
ping_ by_ name - Collect and submit a ping for eventual uploading by name.
- submit_
pings_ by_ name - Collect and submit multiple pings by name for eventual uploading.