23 stable releases (11 major)

✓ Uses Rust 2018 edition

new 30.1.0 May 22, 2020
29.1.1 May 22, 2020
28.0.0 Apr 24, 2020
27.1.0 Apr 9, 2020
0.0.0 Sep 24, 2019

#1 in #telemetry

Download history 23/week @ 2020-01-25 32/week @ 2020-02-01 67/week @ 2020-02-08 130/week @ 2020-02-15 134/week @ 2020-02-22 13/week @ 2020-02-29 57/week @ 2020-03-07 38/week @ 2020-03-14 105/week @ 2020-03-21 58/week @ 2020-03-28 76/week @ 2020-04-04 152/week @ 2020-04-11 46/week @ 2020-04-18 30/week @ 2020-04-25 37/week @ 2020-05-02 58/week @ 2020-05-09

284 downloads per month
Used in 2 crates

MPL-2.0 license

320KB
6K SLoC

Glean SDK

The Glean SDK is a modern approach for a Telemetry library and is part of the Glean project.

glean-core

This library provides the core functionality of the Glean SDK, including implementations of all metric types, the ping serializer and the storage layer. It's used in all platform-specific wrappers.

It's not intended to be used by users directly. Each supported platform has a specific Glean package with a nicer API. A nice Rust API will be provided by the Glean crate.

Documentation

All documentation is available online:

Usage

use glean_core::{Glean, Configuration, CommonMetricData, metrics::*};
let cfg = Configuration {
    data_path: "/tmp/glean".into(),
    application_id: "glean.sample.app".into(),
    upload_enabled: true,
    max_events: None,
};
let mut glean = Glean::new(cfg).unwrap();
let ping = PingType::new("sample", true, true, vec![]);
glean.register_ping_type(&ping);

let call_counter: CounterMetric = CounterMetric::new(CommonMetricData {
    name: "calls".into(),
    category: "local".into(),
    send_in_pings: vec!["sample".into()],
    ..Default::default()
});

call_counter.add(&glean, 1);

glean.submit_ping(&ping, None).unwrap();

License

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/

Dependencies

~7.5MB
~171K SLoC