From 8363f82d4197923e8ee1062de849d2c61e467db4 Mon Sep 17 00:00:00 2001 From: Taddes Date: Wed, 27 Nov 2024 14:53:50 -0500 Subject: [PATCH] feat: Enable Glean probe-scraper task (#1636) feat: Enable Glean probe-scraper task --- .github/workflows/glean-probe-scraper.yml | 10 +++++ glean/metrics.yaml | 4 -- glean/pings.yaml | 19 +++----- glean/src/server_events.rs | 55 ----------------------- 4 files changed, 15 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/glean-probe-scraper.yml diff --git a/.github/workflows/glean-probe-scraper.yml b/.github/workflows/glean-probe-scraper.yml new file mode 100644 index 0000000000..9aa1f7849b --- /dev/null +++ b/.github/workflows/glean-probe-scraper.yml @@ -0,0 +1,10 @@ +--- +name: Glean probe-scraper +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + glean-probe-scraper: + uses: mozilla/probe-scraper/.github/workflows/glean.yaml@main diff --git a/glean/metrics.yaml b/glean/metrics.yaml index d44c3bf1dc..cddefe0d5e 100644 --- a/glean/metrics.yaml +++ b/glean/metrics.yaml @@ -36,7 +36,6 @@ syncstorage: # yamllint enable lifetime: application send_in_pings: - - sync-dau - events notification_emails: - sync-backend@mozilla.com @@ -55,7 +54,6 @@ syncstorage: # yamllint enable lifetime: application send_in_pings: - - sync-dau - events notification_emails: - sync-backend@mozilla.com @@ -74,7 +72,6 @@ syncstorage: # yamllint enable lifetime: application send_in_pings: - - sync-dau - events notification_emails: - sync-backend@mozilla.com @@ -94,7 +91,6 @@ syncstorage: # yamllint enable lifetime: application send_in_pings: - - sync-dau - events notification_emails: - sync-backend@mozilla.com diff --git a/glean/pings.yaml b/glean/pings.yaml index 76d83162a8..6ce9dfeb1a 100644 --- a/glean/pings.yaml +++ b/glean/pings.yaml @@ -1,18 +1,9 @@ +# 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/. + +--- ## Describes the pings being sent out to Glean. # Schema $schema: moz://mozilla.org/schemas/glean/pings/2-0-0 - -# Name -sync-dau: - # Ping parameters - description: | - Ping record for sync active use metrics. - notification_emails: - - sync-backend@mozilla.com - bugs: - - https://github.com/mozilla-services/syncstorage-rs/issues - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1923967 - expires: never - include_client_id: false diff --git a/glean/src/server_events.rs b/glean/src/server_events.rs index 38582438e1..5e993a9d74 100644 --- a/glean/src/server_events.rs +++ b/glean/src/server_events.rs @@ -267,58 +267,3 @@ impl GleanEventsLogger { self.record_events_ping(&RequestInfo::default(), params) } } - -/// Core struct defining metric fields for the `sync-dau-ping` (Daily Active Users). -pub struct SyncDauPing { - pub syncstorage_device_family: String, // Device family from which sync action was initiated. Desktop PC, Tablet, Mobile, and Other. - pub syncstorage_hashed_device_id: String, // Hashed device id that is associated with a given account. - pub syncstorage_hashed_fxa_uid: String, // User identifier. Uses `hashed_fxa_uid` for accurate count of sync actions. - pub syncstorage_platform: String, // Platform from which sync action was initiated. Firefox Desktop, Fenix, or Firefox iOS. -} - -impl GleanEventsLogger { - /// General `record_events_ping` - record and submit `sync-dau` ping - pub fn record_sync_dau_ping(&self, request_info: &RequestInfo, params: &SyncDauPing) { - // Define the outer `Metrics` map that holds the metric type. - let mut metrics = Metrics::new(); - // Create the inner metric value map to insert into `Metrics`. - metrics.insert( - "string".to_owned(), - HashMap::from([( - "syncstorage.device_family".to_owned(), - Value::String(params.syncstorage_device_family.to_owned().clone()), - )]), - ); - metrics.insert( - "string".to_owned(), - HashMap::from([( - "syncstorage.hashed_device_id".to_owned(), - Value::String(params.syncstorage_hashed_device_id.to_owned().clone()), - )]), - ); - metrics.insert( - "string".to_owned(), - HashMap::from([( - "syncstorage.hashed_fxa_uid".to_owned(), - Value::String(params.syncstorage_hashed_fxa_uid.to_owned().clone()), - )]), - ); - metrics.insert( - "string".to_owned(), - HashMap::from([( - "syncstorage.platform".to_owned(), - Value::String(params.syncstorage_platform.to_owned().clone()), - )]), - ); - - let events: Vec = Vec::new(); - self.record("sync-dau", request_info, metrics, events); - } -} - -impl GleanEventsLogger { - /// Record and submit `sync-dau` ping while omitting user request info. - pub fn record_sync_dau_ping_without_user_info(&self, params: &SyncDauPing) { - self.record_sync_dau_ping(&RequestInfo::default(), params) - } -}