Debian Codegraph @

third_party/rust/glean/README.md

raw
1 # Glean
2
3 The `Glean SDK` is a modern approach for a Telemetry library and is part of the [Glean project](https://docs.telemetry.mozilla.org/concepts/glean/glean.html).
4
5 ## `glean`
6
7 This library provides a Rust language bindings on top of `glean-core`, targeted to Rust consumers.
8
9 ## Documentation
10
11 All documentation is available online:
12
13 * [The Glean SDK Book][book]
14 * [API documentation][apidocs]
15
16 [book]: https://mozilla.github.io/glean/
17 [apidocs]: https://mozilla.github.io/glean/docs/glean/index.html
18
19 ## Example
20
21 ```rust,no_run
22 use glean::{ConfigurationBuilder, Error, metrics::*};
23
24 let cfg = ConfigurationBuilder::new(true, "/tmp/data", "org.mozilla.glean_core.example").build();
25 glean::initialize(cfg)?;
26
27 let prototype_ping = PingType::new("prototype", true, true, vec![]);
28
29 glean::register_ping_type(&prototype_ping);
30
31 prototype_ping.submit(None);
32 ```
33
34 ## License
35
36 This Source Code Form is subject to the terms of the Mozilla Public
37 License, v. 2.0. If a copy of the MPL was not distributed with this
38 file, You can obtain one at http://mozilla.org/MPL/2.0/