Skip to content

Commit

Permalink
feat: glean metrics logic (#1626)
Browse files Browse the repository at this point in the history
feat: glean metrics logic
  • Loading branch information
taddes authored Nov 26, 2024
1 parent 7e21154 commit 9e9869e
Show file tree
Hide file tree
Showing 15 changed files with 458 additions and 36 deletions.
16 changes: 14 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ slog-stdlog = "4.1"
slog-term = "2.6"
tokio = "1"
thiserror = "1.0.26"
uuid = { version = "1.11", features = ["serde", "v4"] }

[profile.release]
# Enables line numbers in Sentry reporting
Expand Down
17 changes: 17 additions & 0 deletions glean/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "glean"
version.workspace = true
license.workspace = true
authors.workspace = true
edition.workspace = true

[dependencies]
chrono.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
uuid.workspace = true

[lib]
name = "glean"
path = "src/lib.rs"
40 changes: 23 additions & 17 deletions glean/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ $schema: moz://mozilla.org/schemas/glean/metrics/2-0-0

# Category
syncstorage:
sync_event:
get_collections:
type: event
description: |
Event to record an instance of sync backend activity initiated by client.
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1923967
expires: never

hashed_fxa_uid:
type: uuid
type: string
# yamllint disable
description: >
User identifier. Uses `hashed_fxa_uid` for accurate count of sync actions.
Expand All @@ -36,10 +34,12 @@ syncstorage:
of new keys being generated during resets or timeouts, whenever encryption
keys change.
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
Expand All @@ -53,10 +53,12 @@ syncstorage:
Platform from which sync action was initiated.
Firefox Desktop, Fenix, or Firefox iOS.
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
Expand All @@ -70,10 +72,12 @@ syncstorage:
Device family from which sync action was initiated.
Desktop PC, Tablet, Mobile, and Other.
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
Expand All @@ -88,10 +92,12 @@ syncstorage:
entirely to associate opt-out or removal requests, as they make use of
the "deletion-request" ping associated with the client side of Sync.
# yamllint enable
lifetime: application
send_in_pings:
- sync-dau
- events
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
Expand Down
6 changes: 2 additions & 4 deletions glean/pings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
$schema: moz://mozilla.org/schemas/glean/pings/2-0-0

# Name
syncstorage:
sync-dau:
# Ping parameters
description: |
Ping record for sync active use metrics.
notification_emails:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
bugs:
- https://github.com/mozilla-services/syncstorage-rs/issues
data_reviews:
Expand Down
3 changes: 3 additions & 0 deletions glean/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! Module related to Glean server metrics.
pub mod server_events;
Loading

0 comments on commit 9e9869e

Please sign in to comment.