fxa_client/telemetry.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5//! # Telemetry Methods
6//!
7//! This component does not currently submit telemetry via Glean, but it *does* gather
8//! a small amount of telemetry about send-tab that the application may submit on its
9//! behalf.
10
11use crate::{ApiResult, Error, FirefoxAccount};
12use error_support::handle_error;
13
14#[uniffi::export]
15impl FirefoxAccount {
16 /// Collect and return telemetry about send-tab attempts.
17 ///
18 /// Applications that register the [`SendTab`](DeviceCapability::SendTab) capability
19 /// should also arrange to submit "sync ping" telemetry. Calling this method will
20 /// return a JSON string of telemetry data that can be incorporated into that ping.
21 ///
22 /// Sorry, this is not particularly carefully documented because it is intended
23 /// as a stop-gap until we get native Glean support. If you know how to submit
24 /// a sync ping, you'll know what to do with the contents of the JSON string.
25 #[handle_error(Error)]
26 pub fn gather_telemetry(&self) -> ApiResult<String> {
27 self.internal.lock().gather_telemetry()
28 }
29}