[][src]Crate glean

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::initialize(cfg, ClientInfoMetrics::unknown());

let prototype_ping = PingType::new("prototype", true, true, vec!());

glean::register_ping_type(&prototype_ping);

prototype_ping.submit(None);

Modules

dispatcher

A global dispatcher queue.

private

The different metric types supported by the Glean SDK to handle data.

Structs

ClientInfoMetrics

Metrics included in every ping as client_info.

CommonMetricData

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

global_glean

Gets a reference to the global Glean object.

initialize

Creates and initializes a new Glean object.

register_ping_type

Register a new PingType.

set_upload_enabled

Sets whether upload is enabled or not.

setup_glean

Sets or replaces the global Glean object.

submit_ping

Collects and submits a ping for eventual uploading.

submit_ping_by_name

Collects and submits a ping for eventual uploading by name.

Type Definitions

Result

A specialized Result type for this crate's operations.