Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable Glean probe-scraper task #1636

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
- sync-backend@mozilla.com
Expand All @@ -55,7 +54,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- sync-backend@mozilla.com
Expand All @@ -74,7 +72,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- sync-backend@mozilla.com
Expand All @@ -94,7 +91,6 @@ syncstorage:
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- sync-backend@mozilla.com
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:
- 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
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)
}
}