Skip to content

Commit

Permalink
feat: Enable Glean probe-scraper task (#1636)
Browse files Browse the repository at this point in the history
feat:  Enable Glean probe-scraper task
  • Loading branch information
taddes authored Nov 27, 2024
1 parent b2af6d6 commit 8363f82
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 73 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/glean-probe-scraper.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions glean/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
Expand All @@ -55,7 +54,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
Expand All @@ -74,7 +72,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
Expand All @@ -94,7 +91,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
Expand Down
19 changes: 5 additions & 14 deletions glean/pings.yaml
Original file line number Diff line number Diff line change
@@ -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:
- [email protected]
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
55 changes: 0 additions & 55 deletions glean/src/server_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GleanEvent> = 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)
}
}

0 comments on commit 8363f82

Please sign in to comment.