mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2025-08-06 11:56:58 +02:00
feat: Enable Glean probe-scraper task (#1636)
feat: Enable Glean probe-scraper task
This commit is contained in:
parent
b2af6d6a77
commit
8363f82d41
10
.github/workflows/glean-probe-scraper.yml
vendored
Normal file
10
.github/workflows/glean-probe-scraper.yml
vendored
Normal file
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user