glean/glean-core
dependabot[bot] 8da7d327db Bump black from 22.8.0 to 22.10.0 in /glean-core/python
Bumps [black](https://github.com/psf/black) from 22.8.0 to 22.10.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.8.0...22.10.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-11 03:16:46 -10:00
..
android Merge pull request #2196 from rosahbruno/1790501-fix-timing-distribution-docs 2022-10-05 04:40:59 -10:00
android-native Bumped version to 51.3.0 (#2209) 2022-09-28 14:31:40 -05:00
build Update glean_parser to v6.1.2 2022-07-29 10:47:01 +02:00
bundle Remove rkv safe-mode toggle. It's default enabled now. 2022-07-20 12:26:13 +02:00
bundle-android Remove rkv safe-mode toggle. It's default enabled now. 2022-07-20 12:26:13 +02:00
ios Upgrade to Xcode 14.0.0 2022-10-11 03:16:04 -10:00
python Bump black from 22.8.0 to 22.10.0 in /glean-core/python 2022-10-11 03:16:46 -10:00
rlb Bumped version to 51.4.0 (#2213) 2022-10-04 14:44:33 -05:00
src Merge pull request #2196 from rosahbruno/1790501-fix-timing-distribution-docs 2022-10-05 04:40:59 -10:00
tests Merge pull request #2196 from rosahbruno/1790501-fix-timing-distribution-docs 2022-10-05 04:40:59 -10:00
ARCHITECTURE.md Remove testHasValue once and for all 2022-07-12 11:56:36 +02:00
Cargo.toml Bumped version to 51.4.0 (#2213) 2022-10-04 14:44:33 -05:00
LICENSE Prepare for crates.io releases 2019-11-04 15:54:15 +01:00
README.md 1557048: Add reason codes to the metrics ping (#649) 2020-02-11 20:40:10 +05:30
build.rs [build] Start using UniFFI for the glean-core crate 2021-11-23 16:24:10 +01:00
megazord.uniffi.toml Adding a uniffi.toml that is compatible with building the AppServices iOS megazord for Focus/Firefox iOS 2022-07-26 13:50:06 -05:00
metrics.yaml Only report the number of overflowing tasks in preinit_tasks_overflow metric 2022-05-02 12:01:11 +02:00
pings.yaml bug 1702622 - Add reasons to 'deletion-request' ping r?janerik 2021-04-29 10:24:12 -04:00
uniffi.toml Kotlin: Use the library name `xul` for the core parts 2022-05-13 14:12:26 +02:00

README.md

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/