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: glean metrics logic #1626

Merged
merged 34 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4d3d59f
update metrics uuid type to string, initial struct definitions
taddes Nov 4, 2024
a297bef
methods for events and specific metrics
taddes Nov 4, 2024
34a310b
add cargo.toml for glean crate
taddes Nov 6, 2024
6329236
create lib.rs for glean
taddes Nov 6, 2024
e2f69c4
add glean import to handlers
taddes Nov 6, 2024
723cf66
add event logger
taddes Nov 6, 2024
20725b7
add record_events_ping call
taddes Nov 6, 2024
bc6afc9
update pings to define a glean-dau ping as well and add lifetime and …
taddes Nov 12, 2024
634d465
update to most recent version of glean parser code for server_events
taddes Nov 12, 2024
69bffc6
update handler code to emit glean event
taddes Nov 12, 2024
a2c793f
pass user agent string to RequestInfo struct
taddes Nov 13, 2024
a94647c
empty string for ip addr
taddes Nov 14, 2024
61c44c6
update official app id and change ip to empty string
taddes Nov 15, 2024
c7880c0
collection refactor for server events ping types
taddes Nov 15, 2024
d23bff8
mozlog compliant Type and Field, remove LogEvelope timestamp and logg…
taddes Nov 15, 2024
1371982
move uuid as workspace dep
taddes Nov 19, 2024
524f263
change to_string instances to to_owned where better
taddes Nov 19, 2024
ddf80a8
update server events types and add glean logger to ServerState
taddes Nov 19, 2024
1d5963f
wrap glean_logger in Arc, reference ServerState in get_collections
taddes Nov 19, 2024
978db1c
add glean_enabled to syncstorage settings, add to ServerState and enf…
taddes Nov 19, 2024
a98a8fe
add fiends to extractors references to ServerState
taddes Nov 19, 2024
ed70257
move variables into Ping struct
taddes Nov 19, 2024
73b55d1
missing refs in extractors and test for syncserver
taddes Nov 19, 2024
ab592f8
variance between local and ci clippy
taddes Nov 19, 2024
6517bc1
remove unused import
taddes Nov 19, 2024
a2192a8
add GleanEventsLogger to test
taddes Nov 19, 2024
335e8d0
update notification emails to sync-backend team
taddes Nov 19, 2024
d3c54ff
update uuid
taddes Nov 20, 2024
6c012c5
r add additional docstrings and context comments
taddes Nov 21, 2024
cfc1e53
review comments and doc updates
taddes Nov 23, 2024
3a43ade
review comments, add environment field, update default return for emp…
taddes Nov 26, 2024
ff51c6f
rename to sync_environment
taddes Nov 26, 2024
525f789
clippy didn't get mad locally
taddes Nov 26, 2024
5af3c7f
rmv sync prefix
taddes Nov 26, 2024
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
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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- 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

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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- sync-backend@mozilla.com
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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- sync-backend@mozilla.com
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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- sync-backend@mozilla.com
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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- sync-backend@mozilla.com
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:
- jrconlin@mozilla.com
- pjenvey@mozilla.com
- tkorris@mozilla.com
- sync-backend@mozilla.com
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